AngouriMath

Navigation

← Back to list of members

FindRational​(PeterO.​Numbers.​EDecimal,​System.​Int32)

 Method (no overloads)

Summary

Tries to find a pair of two Integers
(which are components that make up a Rational)
so that its rational value is equal to num.
To set some options for this function, you can use
MaxAbsNumeratorOrDenominatorValue to limit the absolute value of both denominator and numerator.

Parameter "num"

e.g. 1.5m -> 3/2

Parameter "iterCount"

Number of iterations allowed to be spent for searching the rational.
A higher value indicates a higher probability that it will find a Rational.
Defaults to FloatToRationalIterCount.

Returns

Rational if found, null otherwise.

























Angouri © 2019-2023 · Project's repo · Site's repo · Octicons · Transparency · 1534 pages online