Calculation problem
pusink
Posts: 68
the calculation is like this...........
LONG S
S := (390/300) * 60
i get value S = 60....
how to get·S = 78 ?
how to solve with *.spin?
·
LONG S
S := (390/300) * 60
i get value S = 60....
how to get·S = 78 ?
how to solve with *.spin?
·
Comments
S := ((390 * 60) / 300)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
390 / 360 == 1 in integer arithmetic.
-Phil
If you want to work with decimal values, then you need to use one of the objects like FloatMath, etc. And you need to read the rules concerning such operations: for example for a float, you need to use a decimal when you assign a value, like, ThisNumber := 123.0 You could not do float math with ThisNumber if you did not include that decimal point.
obex.parallax.com/objects/53/
Post Edited (ElectricAye) : 12/1/2009 6:30:29 AM GMT