Convert a floating point number to a Rational based on integer type SomeIntegral. Allows an error tolerance of epsilon. (Default epsilon = 1e-8.)
epsilon must be greater than 1.0L / long.max.
Exception on infinities, NaNs, numbers with absolute value larger than long.max and epsilons smaller than 1.0L / long.max.
// Prints "22/7". writeln(toRational!int(PI, 1e-1));
See Implementation
Convert a floating point number to a Rational based on integer type SomeIntegral. Allows an error tolerance of epsilon. (Default epsilon = 1e-8.)
epsilon must be greater than 1.0L / long.max.