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
+7.3k Golang : Add text to image and get OpenCV's X, Y co-ordinates example
+50.4k Golang : How to get time in milliseconds?
+8.1k Golang : Scramble and unscramble text message by randomly replacing words
+6.7k Golang : get the current working directory of a running program
+9.4k Golang : Roll the dice example
+4.5k Swift : Convert string array to array example
+16.8k Golang : Get download file size
+4.8k Golang : Launching your executable inside a console under Linux
+9.8k Android Studio : Create custom icons for your application example
+3.6k Linux/MacOSX : Search and delete files by extension
+6.3k Golang : Scanf function weird error in Windows
+9.4k Golang : How to unmarshal JSON inner/nested value and assign to specific struct?