Repeat loop using floating point number
grasshopper
Posts: 438
I am using a repeat loop that counts from 1 to 250 but 250 is in a floating point data type. I can say that it runs fine now, but will this cause problems on various propellers or any future problems that I may get hung up on?
Thanks
Thanks
Comments
It sounds like you just assigned the integer value 250 to a variable and used that for·the REPEAT, which would work fine.
To specify a floating point value, you must use a decimal point·or 'e' for exponent. For example, the floating-point value 250 would have to be specified as 250.0, or 2.5e2, or 25e1.
Such floating point values can only be manipulated at run-time by using routines designed to handle that data type, such as those in floatmath.spin and floatstring.spin.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chip Gracey
Parallax, Inc.
The intention is for existing software to work the same (allbeit faster) on the Prop II as much as possible. Since the Prop II design is still in flux, noone can say for sure whether there will be changes required to the floating point library other than improvements using the new features (like hardware multiply).
If you're interested in how floating point works, read en.wikipedia.org/wiki/IEEE_754-2008 and www.validlab.com/goldberg/paper.ps