Documentation
¶
Index ¶
- Constants
- type Rational
- func New(val float64, iterations int64, stepPrecision float64) Rational
- func NewFromBigIntComponents(num, den *big.Int) Rational
- func NewFromComponents(num, den int64) Rational
- func NewWithDecimalPlaces(val float64, dp int) Rational
- func NewWithIterations(val float64, iterations int64) Rational
- func NewWithPrecision(val float64, stepPrecision float64) Rational
Constants ¶
View Source
const MaxIterations = 5000
MaxIterations is some sane limit of iterations for precision mode
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Rational ¶
func NewFromBigIntComponents ¶
func NewFromComponents ¶
func NewWithDecimalPlaces ¶
func NewWithIterations ¶
NewWithIterations returns rational from decimal using `iterations` number of iterations in Continued Fraction algorithm
func NewWithPrecision ¶
NewWithPrecision returns rational from decimal by going as mush iterations, until next fraction is less than `stepPrecision`
func (Rational) Denominator ¶
func (Rational) DenominatorInt64 ¶
func (Rational) NumeratorInt64 ¶
Click to show internal directories.
Click to hide internal directories.