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 } };
# OUTPUT: «X::Numeric::Real: Can not convert 1+2i to Int: imaginary part not zero␤»

Methods§

method source§

method source(--> Numeric:D)

Returns the number that failed to coerce to Real.

method target§

method target()

Returns the type to which the coercion was attempted.

method reason§

method reason(--> Str:D)

Returns the reason that the conversion failed.

Typegraph§

Type relations for X::Numeric::Real
raku-type-graph X::Numeric::Real X::Numeric::Real X::Numeric::CannotConvert X::Numeric::CannotConvert X::Numeric::Real->X::Numeric::CannotConvert Mu Mu Any Any Any->Mu Exception Exception Exception->Any X::Numeric::CannotConvert->Exception

Expand chart above