Skip to content

Instantly share code, notes, and snippets.

@cjgiridhar
Created January 23, 2019 06:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cjgiridhar/5e22bf8cc0751798b10ce772497a29c9 to your computer and use it in GitHub Desktop.
Save cjgiridhar/5e22bf8cc0751798b10ce772497a29c9 to your computer and use it in GitHub Desktop.
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