I Spy Code - GO

Complex Type

Here is a go lang example that shows an example of the complex type.

Source: (example.go)

package main
 
import "fmt"
 
func main() {
 
   a := complex(100,8)
   fmt.Println(a)
 
   fmt.Println(real(a))
 
   fmt.Println(imag(a))
 
   fmt.Printf("Type:%T \n",a)
}
 

Output:

$ go run example.go
(100+8i)
100
8
Type:complex128