Standard library / math/big

big.Float.Acc()

Inspect whether the latest applicable operation rounded below, exactly to, or above the exact result. Not every operation computes accuracy. Expected stdout: '1.5 Above\n'.

Formal Syntax & Structure

go syntaxgo
func (x *Float) Acc() Accuracy

Return Value

Accuracy

Returns the result described above; see the example for the observed behavior.

Working Example

Example Snippetgo
package main
import (  "fmt"  "math/big")
func main() {  z := new(big.Float).SetPrec(2).SetFloat64(1.3)  fmt.Println(z, z.Acc())}
Go Reference