Dynamic math tutorial?
Jaakko
Posts: 6
Hi!
Does anyone know about some newbie tutorial to DML and FloatMath etc. Things like "Can I feed them with signed integers?" or "Do I have to declare that a variable is a signed integer" or "What are the max input values for this op?". You know, a kind of simple rule book for those without degrees in mathematics.
best regards
Jaakko
Does anyone know about some newbie tutorial to DML and FloatMath etc. Things like "Can I feed them with signed integers?" or "Do I have to declare that a variable is a signed integer" or "What are the max input values for this op?". You know, a kind of simple rule book for those without degrees in mathematics.
best regards
Jaakko
Comments
PS.: What do you refer to by "DML"?
Post Edited (deSilva) : 1/3/2008 5:42:39 PM GMT
I´m a complete newbie but I figured it out; floating point operations need floating point input values and when you want to display the results in the LCD you have to truncate or round them back to integers.Cheers!
DML is DynamicMathLib, I still haven´t found "idiot proof" data about input value limits.
best regards
Jaakko
http://www.rayslogic.com/TimexUSB/Float.htm
(Also is some info on the lesser known S16E7 format...)
Now: converting an integer needs:
float := fm.FFloat(integer)
rounding it back is
integer := fm.FRound(float)
Converting it to a readable string is
OBJ: fs: "FloatString"
stringaddress := fs.FloatToString(float)
But there are more options, read through the comments in the code