mIRC Homepage
Posted By: Bleepy $calc bug - 05/03/04 12:44 AM
//echo -a $calc(100000000000000000000000000000000000000000000000000000000000 + 1)

returns

99999999999999997000000000000000000000000000000000000000000

...
Posted By: DaveC Re: $calc bug - 05/03/04 01:14 AM
wow hope i never need to add 1 to 100000000000000000000000000000000000000000000000000000000000

Posted By: ad3285 Re: $calc bug - 05/03/04 06:31 AM
well according to the post i tried the following:

//echo -a $calc(10000000000000000000000 + 0)
it returns 10000000000000000000000
which is perfectly fine.

but when i try to add another 0 behind
//echo -a $calc(100000000000000000000000 + 0)
it returns 99999999999999992000000

seems like the problems only affect with int numbers bigger than 24char
Posted By: Lodd Re: $calc bug - 05/03/04 08:08 AM
so crazy, isn't it? smile
Posted By: Khaled Re: $calc bug - 05/03/04 04:18 PM
Yes, as with all programming/scripting languages, $calc() handles numbers up to a certain size, anything beyond that will result in overflow and the result is indeterminate.
Posted By: cmad Re: $calc bug - 13/03/04 10:53 AM
and it's surprising it can handle so big numbers blush
© mIRC Discussion Forums