Page 1 of 1

Accessing bit fields in floating point values

Posted: Tue Feb 12, 2013 1:52 pm
by YahooArchive
>from the help line
>How do I access the mantissa and exponent fields of the 32bit word?
>I don't see how to fool the compiler into allowing boolean ops on an FP word.

You fool the compiler (which is how I describe it as well) the same way as in C

C --

i = * (int *) &x; // need type casts in C

BASIC --

i = * (addressof x)

Now you can do bit field tests on the integer. This is how we do detection of
Inf and NaN -- infinity and not-a-number, which happens when you exceed the
E+/-38 range of floating points.