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 package. So, you need to add a math package in your program with the help of the import keyword to access the Inf() function.
func Inf(sign int) float64
Result 1: -Inf Result 2: +Inf
Positive infinity: +Inf Negative infinity: -Inf