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