double to 2^53
#1
Ok, I know that the size of the mantissa of double is 53 bits, see if you can guess what values will be printed by this snippet

Code: (Select All)
Dim As Double x

x = 9007199254740992 ' 2^53
Print x
x = x + 1#
Print x
x = x + 1#
Print x
Print "================="
x = 9007199254740998
Print x
x = x + 1#
Print x
x = x + 1#
Print x
Print "================="
x = 9999999999999998
Print x
x = x + 1#
Print x
Reply


Messages In This Thread
double to 2^53 - by Jack - 05-03-2023, 02:49 PM
RE: double to 2^53 - by SMcNeill - 05-03-2023, 07:04 PM
RE: double to 2^53 - by Jack - 05-03-2023, 07:09 PM
RE: double to 2^53 - by SMcNeill - 05-03-2023, 07:45 PM
RE: double to 2^53 - by Jack - 05-03-2023, 08:31 PM



Users browsing this thread: 1 Guest(s)