At 5:11 PM -0700 4/13/99, Michael S. Davis wrote:
>I have tried to come up with the smallest example code as
>an example of my question.  This example has one form, one field
>(fldFloat), one button.  All it does is execute DoFloat() when
>the button is pressed.  If the answer is correct it displays
>correct and incorrect if the answer is incorrect.  This way
>I do not have to rely on FToA functions of NewFloatMgr.
>
>When I press the button, "correct" is displayed.  I have changed
>the values of fp1 to get an incorrect answer and recompiled.
>Using that new value for fp1, "incorrect" is displayed.
>
>But let me ask this question:  Using gcc, and not using any
>special compiler options and NOT including NewFloatMgr.h, and
>using gcc NOT CW, does this code represent the use of floats without
>NewFloatMgr?
>
>If not what am I missing?  Any comments would be appreciated.

I guess it all depends on what one means when one asks "Am I using 
NewFloatMgr or not?".  The IEEE 32-bit float and 64-bit double 
floating point support in Palm OS *IS* in NewFloatMgr.  In addition, 
there are a small number of utility routines in NewFloatMgr (like 
FlpFToA, FlpAToF and FlpBase10Info to name a few).  In order to make 
these routines accessible before the developer tools knew about them 
(namely CodeWarrior and GCC), NewFloatMgr.h had to define all of the 
necessary types and routine definitions to allow code to talk to the 
fp engine.

Now that the tools know how to provide native support for floats and 
doubles, most of that stuff should probably be hidden in a Prv file 
to reduce confusion.

It's perfectly reasonable to use the standard float and double types, 
and the operators that go with them.  Behind your back, your compiler 
will implement these operations using Palm OS (NewFloatMgr) system 
calls.  You needn't include NewFloatMgr.h in order for this to 
happen.  However, you may need to tell your compiler to generate Palm 
FP code instead of, say, Apple SANE code (in the case of 
"CodeWarrior).

In addition, as some have pointed out, code that depends on the 
NewFloatMgr fp engine will NOT work on Palm OS 1.0 (unless it's built 
using the staticly linked NewFloatMgr library).  However, that 
shouldn't really bother anyone at this point, as support for 1.0 is 
rapidly dying.

If this still isn't clear, let me know.
--Steve

Reply via email to