Floating point identification how is it done? last bit ?
Zap-o
Posts: 452
Is there a specific way that I can check a bit in a variable to tell if it is in floating point form.
For example:
I have some data entered into a variable and before I manipulate it and use the "math.Fadd" function I need to know beforehand to float it or leave it.
Any help is appreciated.
Post Edited (Zap-o) : 7/22/2009 10:07:38 PM GMT
For example:
I have some data entered into a variable and before I manipulate it and use the "math.Fadd" function I need to know beforehand to float it or leave it.
IF varable is not a floating point math.Ffloat this variable else math.Ffloat(variable, 1.02)
Any help is appreciated.
Post Edited (Zap-o) : 7/22/2009 10:07:38 PM GMT
Comments
Nick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never use force, just go for a bigger hammer!
The DIY Digital-Readout for mills, lathes etc.:
YADRO
The entire 32 bits are used to represent the FP number. There is no way to determine if it's signed/unsigned/fp...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<This space for rent>
-Phil
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
April, 2008: when I discovered the answers to all my micro-computational-botherations!
But apart from that, any random number could be a valid float number, even if it wasn't intended to be.
If you really need this functionality, maybe you could set up a separate array of flag bits to track the status of your numbers; whether they have been converted to float or not.
-Phil
Even these are valid and very useful values!
Nick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never use force, just go for a bigger hammer!
The DIY Digital-Readout for mills, lathes etc.:
YADRO