Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Primitive Data Types in Go - complex
package main
import "fmt"
func main() {
var (
pi float32 = 3.1416 //floating point number
z complex128 = -5 + 12i //complex number
)
/* creating a complex number */
var complx = complex(3, 4) //returns 3+4i
fmt.Println(pi, z, complx)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.