math/big
Package big implements arbitrary-precision arithmetic (big numbers).
Index
- func Jacobi(x, y *Int) int
- func ParseFloat(s string, base int, prec uint, mode RoundingMode) (f *Float, b int, err error)
- func NewFloat(x float64) *Float
- func NewInt(x int64) *Int
- func NewRat(a, b int64) *Rat
Functions
func Jacobi
1func Jacobi(x, y *Int) int
Jacobi returns the Jacobi symbol (x/y), either +1, -1, or 0. The y argument must be an odd integer.
func ParseFloat
1func ParseFloat(s string, base int, prec uint, mode RoundingMode) (f *Float, b int, err error)
ParseFloat is like f.Parse(s, base) with f set to the given precision and rounding mode.
func NewFloat
1func NewFloat(x float64) *Float
NewFloat allocates and returns a new Float set to x, with precision 53 and rounding mode ToNearestEven. NewFloat panics with ErrNaN if x is a NaN.
func NewRat
1func NewRat(a, b int64) *Rat
NewRat creates a new Rat with numerator a and denominator b.