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
+22.3k Golang : How to run Golang application such as web server in the background or as daemon?
+18.6k Golang : Example for RSA package functions
+17.6k Golang : Linked list example
+17.2k Golang : Fix cannot convert buffer (type *bytes.Buffer) to type string error
+16.8k Golang : Generate QR codes for Google Authenticator App and fix "Cannot interpret QR code" error
+8.7k Linux/Unix : fatal: the Postfix mail system is already running
+6.8k Golang : Output or print out JSON stream/encoded data
+8.6k Golang : How to check variable or object type during runtime?
+9.1k Golang : Inject/embed Javascript before sending out to browser example
+4.9k Facebook : How to place save to Facebook button on your website
+10.7k Golang : Create matrix with Gonum Matrix package example
+52k Golang : How to get time in milliseconds?