function bug ?

Blitz3D Forums/Blitz3D Programming/function bug ?

Leszek(Posted 2010) [#1]
Hi I seek a bug with function.
Example:

Function Newton( m# )
Local F#=m * 9.81
Return F
End Function

Ok, for example m=12.142 and in blitz3d print me a 119 but in my calculator i have a 119.11302

Where is .11302 ?

Help

Leszek


GitTech(Posted 2010) [#2]
Function Newton#( m# )
Local F#=m * 9.81
Return F
End Function



big10p(Posted 2010) [#3]
Functions return integers by default. You need to use 'Function Newton#(m#)' instead.

[edit] beaten to it.


Kryzon(Posted 2010) [#4]
Not really.

He gave the code + you the explanation = documentation.


Leon Drake(Posted 2010) [#5]
@kryzon

+ explanation of obvious documentation + leon drake trolling = successful thread