Welcome to the Monastery | |
PerlMonks |
Re: Arithmetic on numbers bigger than 1<<31by zude (Scribe) |
on May 13, 2004 at 22:40 UTC ( [id://353233]=note: print w/replies, xml ) | Need Help?? |
The problem is that the "%d" implies a conversion to a bitwise integer,and IMHO perl is extremely broken in this regard.
Anything larger than 2**32-1 is converted to 2**32-1 (aka -1). Anything smaller than -2**31 is converted to 2**31 (aka -2**31). Nothing else works this way. Certainly not libm. Whatever, it can really screw you if you aren't careful: I hate it when that happens.
In Section
Seekers of Perl Wisdom
|
|