complx.Inf() Function in Golang With Examples Last Updated : 17 May, 2020 Comments Improve Suggest changes 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.Inf() 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 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 fmt.Printf() Function in Golang With Examples In Go language, fmt package implements formatted I/O with functions analogous to C's printf() and scanf() function. The fmt.Printf() function in Go language formats according to a format specifier and writes to standard output. Moreover, this function is defined under the fmt package. Here, you need 3 min read reflect.Bool() 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.Bool() Function in Golang is used to get Value underlying value. To access this function, one needs to imports th 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