math

package
v0.10.0-rc3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 14, 2023 License: Apache-2.0, MIT Imports: 2 Imported by: 3

Documentation

Index

Constants

View Source
const Precision128 = 128

note: all coefficients for which Polyval is used would need to be updated if this precision changes

Variables

This section is empty.

Functions

func ExpNeg

func ExpNeg(x *big.Int) *big.Int

ExpNeg accepts x in Q.128 format and computes e^-x. It is most precise within [0, 1.725) range, where error is less than 3.4e-30. Over the [0, 5) range its error is less than 4.6e-15. Output is in Q.128 format.

func Ln

func Ln(z big.Int) big.Int

The natural log of Q.128 x.

func Parse

func Parse(coefs []string) []*big.Int

Parse a slice of strings (representing integers in decimal) Convention: this function is to be applied to strings representing Q.128 fixed-point numbers, and thus returns numbers in binary Q.128 representation

func Polyval

func Polyval(p []*big.Int, x *big.Int) *big.Int

polyval evaluates a polynomial given by coefficients `p` in Q.128 format at point `x` in Q.128 format. Output is in Q.128. Coefficients should be ordered from the highest order coefficient to the lowest.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL