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) *FloatParameters & Attributes
| Name | Type | Description |
|---|---|---|
| mode | RoundingMode | Rounding 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())}