16777216 is exactly correct because we're working with integers. Rounding 16777215.999999976 down to 16777215 makes no sense. Correct rounding would, indeed, give the correct answer. That means rounding to the nearest integer.
On this same note, I discovered something very unusual. If you run
..you get 16777216.000000000 (correct). But if you run
..the result for 2 ^ 24 is 16777215.999999976 (wrong!)! Do literals get converted differently than variables, and if so, why?
Russell
On this same note, I discovered something very unusual. If you run
Print 2 ^ 24
..you get 16777216.000000000 (correct). But if you run
For a = 0 To 31 Print 2 ^ a Next
..the result for 2 ^ 24 is 16777215.999999976 (wrong!)! Do literals get converted differently than variables, and if so, why?
Russell