method Rat

Documentation for method Rat assembled from the following types:

role Numeric

From Numeric

(Numeric) method Rat

method Rat(Numeric:D: Real $epsilon = 1.0e-6 --> Rat:D)

If this Numeric is equivalent to a Real, return a Rat which is within $epsilon of that Real's value. Fail with X::Numeric::Real otherwise.

role Real

From Real

(Real) method Rat

method Rat(Real:D: Real $epsilon = 1e-6)

Converts the number to a Rat with the precision $epsilon.

class RatStr

From RatStr

(RatStr) method Rat

method Rat

Returns the Rat value of the RatStr.