class X::Numeric::Real is Exception { }
Occurs when an attempt to coerce a Numeric
to a Real
, Num
, Int
or Rat
fails (due to a number with a nonzero imaginary part, for instance).
For example
say (1+2i).Int;
CATCH { default { put .^name, ': ', .Str } };
method source(--> Numeric:D)
Returns the number that failed to coerce to Real.
Returns the type to which the coercion was attempted.
Returns the reason that the conversion failed.
Type relations for X::Numeric::Real
Expand chart above