mIRC Home    About    Download    Register    News    Help

Topic Options
#73749 - 05/03/04 12:44 AM $calc bug
Bleepy Offline
Ameglian cow

Registered: 02/05/03
Posts: 31
Loc: Sussex, England.
//echo -a $calc(100000000000000000000000000000000000000000000000000000000000 + 1)

returns

99999999999999997000000000000000000000000000000000000000000

...
_________________________
@#HelpDesk - DALnet

Top
#73750 - 05/03/04 01:14 AM Re: $calc bug
DaveC Offline
Planetary brain

Registered: 26/09/03
Posts: 4230
wow hope i never need to add 1 to 100000000000000000000000000000000000000000000000000000000000


Top
#73751 - 05/03/04 06:31 AM Re: $calc bug
ad3285 Offline
Mostly harmless

Registered: 17/12/02
Posts: 1
Loc: Singapore
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

Top
#73752 - 05/03/04 08:08 AM Re: $calc bug
Lodd Offline
Pikka bird

Registered: 18/12/02
Posts: 18
Loc: Shanghai, China
so crazy, isn't it? smile

Top
#73753 - 05/03/04 04:18 PM Re: $calc bug
Khaled Offline


Planetary brain

Registered: 04/12/02
Posts: 4343
Loc: London, UK
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.

Top
#73754 - 13/03/04 10:53 AM Re: $calc bug
cmad Offline
Babel fish

Registered: 06/01/04
Posts: 79
Loc: Greece
and it's surprising it can handle so big numbers blush
_________________________
My ally is the compiler, and a powerful ally it is!

Top