Request for parsing floats

BlitzMax Forums/BlitzMax Programming/Request for parsing floats

taumel(Posted 2006) [#1]
Hi,

i would like to request that i'm able to just write

dum:float=1. instead of dum:float=1.0

like it's also possible to write both .1 and 0.1


Thanks,

taumel


TomToad(Posted 2006) [#2]
You can write dum:float=1 without the dot.
Isn't this in the wrong forum anyway?


taumel(Posted 2006) [#3]
It identifies floats for me much more easier if i use them in the code for calculations after defining them and i'm used to this from other languages as well.

Where is the request forum then?


marksibly(Posted 2006) [#4]
Sorry, but I think '1.' is pretty ugly.

Is it 'one point nothing' or is it 'one full stop'?

Request denied!


Fabian.(Posted 2006) [#5]
You could write 1#
Local x:Float = 1#



ImaginaryHuman(Posted 2006) [#6]
If it's 1.0 you can do dum:float=1 but what is happening is an Int with value 1 is converted to float and stored in the variable. You have to be careful with that, it only works for whole numbers with no decimal part.