Long integer problem

BlitzMax Forums/BlitzMax Programming/Long integer problem

pete03(Posted 2011) [#1]
I just cant believe this is happening.

Global uid:Long = $bbbbbbbbb 'that is 8*b
Print LongHex(longl)

displays FFFFFFFFBBBBBBBB


Global uid:Long = $bbbbbbbbbb 'that is 7*b
Print LongHex(longl)

displays 00000000BBBBBBB

This is scary - I have tried all kinds of stuff with LONG - something up ? I'm sure someone else would have noticed this. I'm using version 1.4 and 1.42 Linux and win same problem. Any ideas?


Yasha(Posted 2011) [#2]
Try appending ":Long" to your numeric literals if you want them to come out properly as 64-bit instead of being converted via 32-bit:

Global uid:Long = $bbbbbbbbb:Long



pete03(Posted 2011) [#3]
Well thankyou kindly - I have been pulling my hair out - wish I had asked earlier.


Floyd(Posted 2011) [#4]
I still occasionally forget that floating point numeric literals default to single precision.