Standard library / math

math.Inf()

Returns negative infinity for negative sign, positive infinity otherwise. Expected stdout: '-Inf\n'.

Formal Syntax & Structure

go syntaxgo
func Inf(sign int) float64

Parameters & Attributes

NameTypeDescription
signintSign selector.

Return Value

float64

Returns negative infinity for negative sign, positive infinity otherwise.

Working Example

Example Snippetgo
package main
import (  "fmt"  "math")
func main() {  fmt.Println(math.Inf(-1))}
Go Reference