diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1999-07-18 01:16:59 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1999-07-18 01:16:59 +0000 |
commit | 47f6b1df3e028ac6a813ea58707e6a92837c0659 (patch) | |
tree | 7280e1a6ff0b723c010b6e6dfa905f6ef4084b96 /lib/integer.pm | |
parent | 517db07721f121446b16672c63a0ca8d753c8eea (diff) | |
download | perl-47f6b1df3e028ac6a813ea58707e6a92837c0659.tar.gz |
mention the -Minteger effect on modulus (from Nathan Torkington)
p4raw-id: //depot/perl@3690
Diffstat (limited to 'lib/integer.pm')
-rw-r--r-- | lib/integer.pm | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/integer.pm b/lib/integer.pm index 894931896f..f6be58a0eb 100644 --- a/lib/integer.pm +++ b/lib/integer.pm @@ -28,6 +28,17 @@ code you'll be left with C<$x == 1.5>, C<$y == 2> and C<$z == -1>. The $z case happens because unary C<-> counts as an operation. +Native integer arithmetic (as provided by your C compiler) is used. +This means that Perl's own semantics for arithmetic operations may +not be preserved. One common source of trouble is the modulus of +negative numbers, which Perl does one way, but your hardware may do +another. + + % perl -le 'print (4 % -3)' + -2 + % perl -Minteger -le 'print (4 % -3)' + 1 + See L<perlmod/Pragmatic Modules>. =cut |