complx.Inf() Function in Golang With Examples Last Updated : 17 May, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report 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() Function package main // importing fmt and math/cmplx import ( "fmt" "math/cmplx" ) // calling main method func main() { // returns the complex Infinite number fmt.Printf("%f", cmplx.Inf()) } Output: (+Inf+Infi) Example 2: You can also generate a complex infinite number as shown below C // Golang program to generate // complex infinite number package main // importing fmt and math import ( "fmt" "math" ) // calling main method func main() { // returns a infinite value inf := math.Inf(1) // make a complex infinite number cmp := complex(inf, inf) // print the number fmt.Printf("%f", cmp) } Output: (+Inf+Infi) Comment More infoAdvertise with us Next Article complx.IsInf() Function in Golang With Examples P PranchalKatiyar Follow Improve Article Tags : Go Language Golang-Complex Similar Reads complx.IsInf() Function in Golang With Examples complx.IsInf() Function in Golang reports whether either real(x) or imag(x) is an infinity. The returned value is boolean. Syntax: func IsInf(x complex128) bool Here, x is the set of all complex numbers with float64 real as well as imaginary parts. Return Value: This returns a boolean value, either 1 min read complx.IsNaN() Function in Golang With Examples In Go language, cmplx packages supply basic constants as well as mathematical functions for the complex numbers. The IsNaN() function in Go language is used to check if either the stated real(x) or imag(x) is NaN or not and is neither an infinity. Moreover, this function is defined under the cmplx p 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.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.Exp() Function in Golang With Examples 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 1 min read math.Inf() Function in Golang With Examples Go language provides inbuilt support for basic constants and mathematical functions to perform operations on the numbers with the help of the math package. You can find positive infinity (if sign >= 0) or negative infinity (if sign < 0) with the help of the Inf() function provided by the math 2 min read Like