Why does Int ^ Int get cast to Double?

BlitzMax Forums/BlitzMax Programming/Why does Int ^ Int get cast to Double?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

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
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