method Num
1 | class Numeric |
1.1 | (Numeric) method Num |
2 | class NumStr |
2.1 | (NumStr) method Num |
3 | role Rational |
3.1 | (Rational) method Num |
Documentation for method Num
assembled from the following types:
class Numeric
From Numeric
(Numeric) method Num
method Num(Numeric: --> Num)
If this Numeric
is equivalent to a Real
, return that Real
as a Num
as accurately as is possible. Fail with X::Numeric::Real
otherwise.
class NumStr
From NumStr
(NumStr) method Num
method Num
Returns the Num
value of the NumStr
.
role Rational
From Rational
(Rational) method Num
Defined as:
method Num(Rational: --> Num)
Coerces the invocant to Num by dividing numerator by denominator. If denominator is 0
, returns Inf
, -Inf
, or NaN
, based on whether numerator is a positive number, negative number, or 0
, respectively.