Golang builtin.real() function example

package builtin

The real built-in function returns the real part of the input complex number

Golang builtin.real() function usage example

package main

 import "fmt"

 func main() {
 fmt.Println(real(100 + 8i))
 }

Output :

100

Reference :

http://golang.org/pkg/builtin/#real

Advertisement