Divide problem

Blitz3D Forums/Blitz3D Programming/Divide problem

Can anyone tell me why this will not return the correct value of 0.78125 ?

GW# = 800/1024

It spitting out 0.0

try Float(Float(800)/Float(1024))
that should do it ;)

gw# = 800.0/1024 works

Yea, you need to put the decimal point in one or both of the numbers, or blitz assumes your looking for an integer result. Even if the target variable is a float.

Yeah I think Blitz does this to speed up stuff or conserve memory somewhere, but it always tries to use integers unless expressly decreed that you want a float!