diff options
author | Ilya Zakharevich <ilya@math.berkeley.edu> | 2001-01-24 14:06:57 -0500 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-01-25 04:16:32 +0000 |
commit | f216259dc50e3a06164781e025bbb486cdc1dbaa (patch) | |
tree | e8ed6fb1558ef7ad342bdb1e96cef33c01c92f07 /lib/overload.pm | |
parent | f2766b05f6136cc9e8c8812afdbe7a31657a110d (diff) | |
download | perl-f216259dc50e3a06164781e025bbb486cdc1dbaa.tar.gz |
overload int()
Message-ID: <20010124190657.A8512@math.ohio-state.edu>
p4raw-id: //depot/perl@8545
Diffstat (limited to 'lib/overload.pm')
-rw-r--r-- | lib/overload.pm | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/overload.pm b/lib/overload.pm index 69092a00cf..712c8eda57 100644 --- a/lib/overload.pm +++ b/lib/overload.pm @@ -123,7 +123,7 @@ sub mycan { # Real can would leave stubs. binary => "& | ^", unary => "neg ! ~", mutators => '++ --', - func => "atan2 cos sin exp abs log sqrt", + func => "atan2 cos sin exp abs log sqrt int", conversion => 'bool "" 0+', iterators => '<>', dereferencing => '${} @{} %{} &{} *{}', @@ -370,11 +370,16 @@ postfix form. =item * I<Transcendental functions> - "atan2", "cos", "sin", "exp", "abs", "log", "sqrt", + "atan2", "cos", "sin", "exp", "abs", "log", "sqrt", "int" If C<abs> is unavailable, it can be autogenerated using methods for "E<lt>" or "E<lt>=E<gt>" combined with either unary minus or subtraction. +Note that traditionally the Perl function L<int> rounds to 0, thus for +floating-point-like types one should follow the same semantic. If +C<int> is unavailable, it can be autogenerated using the overloading of +C<0+>. + =item * I<Boolean, string and numeric conversion> "bool", "\"\"", "0+", |