Standard library / math/big
big.ToPositiveInf
Rounds toward positive infinity. Expected stdout: '-4\n'.
Formal Syntax & Structure
go syntaxgo
const ToPositiveInf RoundingMode = 5Working Example
Example Snippetgo
package main
import ( "fmt" "math/big")
func main() { fmt.Println(new(big.Float).SetPrec(2).SetMode(big.ToPositiveInf).SetInt64(-5))}