Standard library / math/big

big.Float.SetInf()

Set positive infinity when signbit is false and negative infinity otherwise. This method writes to the receiver (use a separate destination to preserve inputs when needed). Expected stdout: '-Inf\n'.

Formal Syntax & Structure

go syntaxgo
func (z *Float) SetInf(signbit bool) *Float

Parameters & Attributes

NameTypeDescription
signbitboolTrue selects negative infinity; false selects positive infinity.

Return Value

*Float

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(true))}
Go Reference