Converting an integer to a float
John_B
Posts: 16
Hi
Is it possible to type cast an integer to float?
I have 2 integer values returned from cogs which are then manipluated by the spin code, the result being a float.
Using the following as an example (that obviously doesn't work), how can it be made to work?
long a
long b
long c
a := 999999
b := 4321
c·:= fMath.fDiv(a,b)
Cheers
John
Is it possible to type cast an integer to float?
I have 2 integer values returned from cogs which are then manipluated by the spin code, the result being a float.
Using the following as an example (that obviously doesn't work), how can it be made to work?
long a
long b
long c
a := 999999
b := 4321
c·:= fMath.fDiv(a,b)
Cheers
John
Comments
Using the integer to float method in the floatMath object.
c := fMath.fDiv(fMath.fFloat(a), fMath.fFloat(b))