complx.Exp() Function in Golang With Examples Last Updated : 28 Apr, 2020 Comments Improve Suggest changes Like Article Like Report complx.Exp() Function in Golang is used to returns e**x, the base-e exponential of x. Syntax: func Exp(x complex128) complex128 Here, x is the set of all complex numbers real as well as imaginary parts. Return Type: The return type of this function is a complex number. Example 1: C // Golang program to illustrate // the complx.Exp() Function package main // importing fmt and math/cmplx import ( "fmt" "math/cmplx" ) // Calling main method func main() { // using the function fmt.Printf("%.2f", cmplx.Exp(5 + 6i)) } Output: (142.50-41.47i) Example 2: C // Golang program to illustrate // the complx.Exp() Function package main // importing fmt and math/cmplx import ( "fmt" "math/cmplx" ) // Calling main method func main() { n := complex(7, 8) // using the function fmt.Printf("%.2f", cmplx.Exp(n)) } Output: (-159.56+1084.96i) Comment More infoAdvertise with us Next Article complx.Exp() Function in Golang With Examples P PranchalKatiyar Follow Improve Article Tags : Go Language Golang-Complex Similar Reads complx.Pow() Function in Golang With Examples complx.Pow() Function in Golang is used to find x**y, the base-x exponential of y. For this function, one need to import the "math/cmplx" package. Syntax: func Pow(x, y complex128) complex128 Pow(0, ±0) returns 1+0i Pow(0, c) for real(c)<0 returns Inf+0i if imag(c) is zero, otherwise Inf+Inf i Pa 1 min read complx.Inf() Function in Golang With Examples complx.Inf() Function in Golang is used to returns a complex infinity, complex(+Inf, +Inf). TO use this function one must need to import the "math/cmplx" package. Syntax: func Inf() complex128 Return Type: It returns a complex infinity. Example 1: C // Golang program to illustrate // the complx.Inf( 1 min read complx.NaN() Function in Golang With Examples complx.NaN() function in Golang is used to returns a complex ânot-a-numberâ value. Syntax: func NaN() complex128 It returns the complex NaN value. Let us discuss this concept with the help of given examples: Example 1: C // Golang program to illustrate // the complx.NaN() Function package main impor 1 min read 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 complx.Polar() Function in Golang With Examples complx.Polar() Function in Golang returns the absolute value r and phase θ of x. The phase θ will be in the range [-Pi, Pi]. Syntax: func Polar(x complex128) (r, θ float64) Here, x is a complex number. Return Value: The return value is in the range [-Pi, Pi]. Example 1: C // Golang 2 min read complx.Phase() Function in Golang with Examples In Go language, cmplx packages supply basic constants as well as mathematical functions for the complex numbers. The Phase() function in Go language is used to return the phase (also called the argument) of a given number. Moreover, this function is defined under the cmplx package. Here, you need to 1 min read io.Copy() Function in Golang with Examples In Go language, io packages supply fundamental interfaces to the I/O primitives. And its principal job is to enclose the ongoing implementations of such king of primitives. The Copy() function in Go language is used to copy from the stated src i.e, source to the dst i.e, destination till either the 3 min read io.CopyN() Function in Golang with Examples In Go language, io packages supply fundamental interfaces to the I/O primitives. And its principal job is to enclose the ongoing implementations of such king of primitives. The CopyN() function in Go language is used to copy "n" bytes from source to the destination. And if dst is implemented by the 3 min read reflect.Complex() 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.Complex() Function in Golang is used to get the v's underlying value. To access this function, one needs to impor 1 min read flag.Bool() Function in Golang With Examples Go language provides inbuilt support for command-line parsing and has functions that could be used to define flags to be used with a command-line program using the flag package. This package provides the flag.Bool() function which is used to define a boolean flag with the specified name, default val 2 min read Like