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:
Complex number a : (100+8i) Complex number b : (8+100i) (108+108i)
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.