Lonint with bmx?

BlitzMax Forums/BlitzMax Programming/Lonint with bmx?


whatelse?

Byte is @
Short is @@

Turns out [a http://www.blitzwiki.org/index.php/Differences_Between_Blitz3D_and_BlitzMAX_:_Language#Variables]BlitzWiki has all this[/a], as well as:

Long is %%

However, %% can't be put at the end of a number to make it Long when assigning it to a Long variable (the way that you put ! at the end of a Double when assigning it).

That is, if you assign a Double like this:

Dbl! = 1.23456789123
Print Dbl
you get a bad result: 1.2345678806304932 because the 1.23456789123 is interpreted as a mere Float. To get the correct result, you need to specify that the number is a Double by using:

Dbl! = 1.23456789123!
Print Dbl
'or
Dbl! = 1.23456789123:Double
Print Dbl
which gives: 1.2345678912300000

However, you can't use %% for a similar purpose with a Long since it gives a compile error:

Lng%% = 123456789123%%
Print Lng
Instead you must use:

Lng%% = 123456789123456789:Long
Print Lng
which gives the correct result (and don't try with nothing on the end like "Lng%% = 123456789123456789" or it'll be interpreted as an Int and give you "-1395630315").