perl6/doc/lib/X/Numeric/Real
doc src
(title) class X::Numeric::Real
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
fails with
Can not convert 1+2i to Int: imaginary part not zero
Methods
(head2) source
method source() returns Numeric:D
Returns the number that failed to coerce to L<Real>.
(head2) target
method target()
Returns the type to which the coercion was attempted.
(head2) reason
method reason() returns Str:D
Returns the reason that the conversion failed.