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) float64Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| sign | int | Sign 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))}