Golang builtin.complex() function example
package builtin
The complex built-in function constructs a complex value from two floating-point values. The real and imaginary parts must be of the same size, either float32 or float64 (or assignable to them), and the return value will be the corresponding complex type (complex64 for float32, complex128 for float64).
Golang builtin.complex() function usage example
package main
import "fmt"
func main() {
fmt.Println(complex(100, 8))
}
Output :
(100+8i)
Reference :
Advertisement
Something interesting
Tutorials
+45.1k Golang : Use wildcard patterns with filepath.Glob() example
+22.3k Golang : How to run Golang application such as web server in the background or as daemon?
+6.4k Golang : Test input string for unicode example
+19.3k Golang : Check if directory exist and create if does not exist
+21.7k Golang : GORM create record or insert new record into database example
+9.9k Golang : Get current, epoch time and display by year, month and day
+12.4k Golang : Get remaining text such as id or filename after last segment in URL path
+12.7k Golang : Get absolute path to binary for os.Exec function with exec.LookPath
+17.3k Golang : When to use init() function?
+22.8k Golang : Strings to lowercase and uppercase example
+10.3k Golang : Text file editor (accept input from screen and save to file)
+9.8k Golang : List available AWS regions