reflect.Complex() Function in Golang with Examples Last Updated : 03 May, 2020 Comments Improve Suggest changes Like Article Like Report Go language provides inbuilt support implementation of run-time reflection and allowing a program to manipulate objects with arbitrary types with the help of reflect package. The reflect.Complex() Function in Golang is used to get the v's underlying value. To access this function, one needs to imports the reflect package in the program. Syntax: func (v Value) Complex() complex128 Parameters: This function does not accept any parameters. Return Value: This function returns the v's underlying value. Below examples illustrate the use of the above method in Golang: Example 1: C // Golang program to illustrate // reflect.complex() Function package main import ( "fmt" "reflect" ) func main() { fmt.Println(reflect.ValueOf(complex(0, 0)).Complex()) } Output: (0+0i) Example 2: C // Golang program to illustrate // reflect.Complex() Function package main import ( "fmt" "reflect" ) const a = complex(100, 8) const b = complex(8, 100) func main() { fmt.Println("Complex number a : ", a) fmt.Println("Complex number b : ", b) c := a + b fmt.Println(reflect.ValueOf(c).Complex()) } Output: Complex number a : (100+8i) Complex number b : (8+100i) (108+108i) Comment More infoAdvertise with us Next Article reflect.Complex() Function in Golang with Examples S SHUBHAMSINGH10 Follow Improve Article Tags : Go Language Golang-reflect Similar Reads complx.Rect() Function in Golang With Examples complx.Rect() Function in Golang returns the complex number x with polar coordinates r, θ. It takes the float value as input and return complex number. This method belongs to complex package. Syntax: func Rect(r, θ float64) complex128; Here, r and θ are the complex numbers with flo 1 min read reflect.Copy() Function in Golang with Examples Go language provides inbuilt support implementation of run-time reflection and allowing a program to manipulate objects with arbitrary types with the help of reflect package. The reflect.Copy() Function in Golang is used to copies the contents of the source into destination until either destination 2 min read reflect.Close() Function in Golang with Examples Go language provides inbuilt support implementation of run-time reflection and allowing a program to manipulate objects with arbitrary types with the help of reflect package. The reflect.Close() Function in Golang is used to close the channel v. To access this function, one needs to imports the refl 2 min read reflect.Cap() Function in Golang with Examples Go language provides inbuilt support implementation of run-time reflection and allowing a program to manipulate objects with arbitrary types with the help of reflect package. The reflect.Cap() Function in Golang is used to get the v's capacity. To access this function, one needs to imports the refle 1 min read reflect.Call() Function in Golang with Examples Go language provides inbuilt support implementation of run-time reflection and allowing a program to manipulate objects with arbitrary types with the help of reflect package. The reflect.Call() Function in Golang is used to calls the function v with the input arguments in. To access this function, o 2 min read Like