Mathamatical Query

Blitz3D Forums/Blitz3D Beginners Area/Mathamatical Query

BODYPRINT(Posted 2003) [#1]
Hi,

I'm using Blitz3D 1.83.

My code looks like this

scle#=.78
scle#=1024/800
Stop

when I debug, scle is equal to 0.0???

Please can somebody tell me why?
My brain hurts :-(


soja(Posted 2003) [#2]
1024/800 is integer division (which turns out to be 1, then when assigned to a float var is 1.0)

what you want to do is this:
scle#=1024.0/800.0

...which is float division. Have fun. =)


BODYPRINT(Posted 2003) [#3]
I never thought about that?

Works fine.
Thanks heaps !!

My brain gives a big sigh of relief :-)