Hi Kristi
,


perl is like most other languages. It counts in binary. The way signed )ie ones that can be positive or negative) are differentiated is the first bit. If the first bit is negative, the number is negative. If I use 3 bit numbers, I would count like this:

000 0
001 1
010 2
011 3
100 -3
101 -2
110 -1
111 -0

So when I add 1 to 3, I actually get -3.

Obviously PERL uses much larger numbers than my puny 3 bit numbers, but the same thing applies, you just have to count a lot higher.


R




At 10:22 24/10/2002 -0500, Goodman Kristi - kgoodm wrote:
Does anyone know why Perl has a hard time with large numbers and sometimes
turns them into negative numbers?  Sorry if I am not being specific enough,
but really all I am doing is calculating the number of records in a file and
if it is a large number of records (lets say over a million) it will return
a negative number for some reason.

Any help appreciated.
Thanks,
Kristi


**********************************************************************
The information contained in this communication is
confidential, is intended only for the use of the recipient
named above, and may be legally privileged.
If the reader of this message is not the intended
recipient, you are hereby notified that any dissemination,
distribution, or copying of this communication is strictly
prohibited.
If you have received this communication in error,
please re-send this communication to the sender and
delete the original message or any copy of it from your
computer system. Thank You.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to