Standard library / math/big

big.Float.IsInf()

Report positive or negative infinity, not large finite numbers. Expected stdout: 'true false\n'.

Formal Syntax & Structure

go syntaxgo
func (x *Float) IsInf() bool

Return Value

bool

Returns the result described above; see the example for the observed behavior.

Working Example

Example Snippetgo
package main
import (  "fmt"  "math/big")
func main() {  fmt.Println(new(big.Float).SetInf(false).IsInf(), big.NewFloat(1).IsInf())}
Go Reference