method narrow
1 | class Numeric |
1.1 | (Numeric) method narrow |
Documentation for method narrow
assembled from the following types:
class Numeric
From Numeric
(Numeric) method narrow
method narrow(Numeric --> Numeric)
Returns the number converted to the narrowest type that can hold it without loss of precision.
say (4.0 + 0i).narrow.perl; # OUTPUT: «4»say (4.0 + 0i).narrow.^name; # OUTPUT: «Int»