method Rat
1 | class Str |
1.1 | (Str) method Rat |
2 | class Numeric |
2.1 | (Numeric) method Rat |
3 | role Real |
3.1 | (Real) method Rat |
4 | class RatStr |
4.1 | (RatStr) method Rat |
Documentation for method Rat
assembled from the following types:
class Str
From Str
(Str) method Rat
Defined as:
method Rat(Str: --> Rational)
Coerces the string to a Rat object, using the same rules as Str.Numeric
. If the denominator is larger than 64-bits is it still kept and no degradation to Num occurs.
class Numeric
From Numeric
(Numeric) method Rat
method Rat(Numeric: Real = 1.0e-6 --> Rat)
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: Real = 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
.