Standard library / math/big

big.Float.SetMode()

Sets rounding mode for future operations and resets accuracy to Exact; returns receiver. Expected stdout: 'ToZero\n'.

Formal Syntax & Structure

go syntaxgo
func (z *Float) SetMode(mode RoundingMode) *Float

Parameters & Attributes

NameTypeDescription
modeRoundingModeRounding mode.

Return Value

*Float

Sets rounding mode for future operations and resets accuracy to Exact; returns receiver.

Working Example

Example Snippetgo
package main
import (  "fmt"  "math/big")
func main() {  v := new(big.Float).SetMode(big.ToZero)  fmt.Println(v.Mode())}
Go Reference