mIRC Home    About    Download    Register    News    Help

Print Thread
#81100 28/04/04 01:24 PM
Joined: Aug 2003
Posts: 72
V
visionz Offline OP
Babel fish
OP Offline
Babel fish
V
Joined: Aug 2003
Posts: 72
$isbit seems buggy when handling large numbers (64bits)

//echo -a $base(9223372208653468868,10,2)
//echo -a $isbit(9223372208653468868,1)

Should returns 0, but returns 1

using mIRC 6.14

#81101 28/04/04 03:21 PM
Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
mIRC makes no warranty for the calculation of numbers greater than 15 digits in length.

This is a conservative figure, as some functions work just fine for values 16 digits and longer. However, most of mIRC's math uses a 64 bit floating point, which leaves only 48 bits for intergers.

Just avoid figures greater than 281474976710655. ( 2^48 - 1 )

___

PS. Again, 2^48 is a conservative safety limit.
$calc appears to get 2^49 through 2^56 correct, yet it can't even add:
9999999999999998 + 1 (which only uses 54 bits of memory, and is 16 digits long)
While 2^56 == 72057594037927936 (which needs 57 bits of memory, and is 17 digits)

beats me.

Last edited by Raccoon; 28/04/04 04:18 PM.

Well. At least I won lunch.
Good philosophy, see good in bad, I like!
#81102 28/04/04 04:45 PM
Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
After wasting more time on this, cuz I obviously have nothing better to do, I've come to the conclusion that the largest number mIRC can accurately calculate in successive series is:

2^53 or 9007199254740992

Any odd number results larger than this are rounded down to the nearest even number, giving a false sense of accuracy, as some of your answers are correct some of the time.

In short, mIRC does not support numbers larger than 2^53 with any warranty of accuracy.

- Raccoon


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
#81103 28/04/04 08:20 PM
Joined: Aug 2003
Posts: 72
V
visionz Offline OP
Babel fish
OP Offline
Babel fish
V
Joined: Aug 2003
Posts: 72
okay! Thanks for the information!


Link Copied to Clipboard