>I asked this question a while back and never got an answer.
>
>"Why would/should one use NewFloatMgr instead of double, float,
>etc?"  Can someone list all the resons to use NewFloatMgr.
>
>Case in point, I also notice that MathLib, that everyone uses,
>does not use NewFloatMgr and seems to do just fine.
>
>I know this has something to do with code size but are there
>other reasons to use it?
>
>Thanks

Wow. What a lot of incorrect 'information' I've read on this thread. You
really do have to take a lot of what you read in this list with a couple of
grains of salt.

Anyway, as you've probably gathered by now, many people do not use
NewFloatMgr and our apps don't crash (as someone replied he thought they
would), using both floats and doubles (as someone suggested you couldn't.)
As you also found out for yourself - I assume by looking at the freely
available source, MathLib does not use NewFloatMgr (as someone said it did.)

One potential reason to use NewFloatMgr is to be able to use the PalmOS
string/float conversion functions, though there are conversion routines
freely available for simple float/double usage.

Additionally, if you are writing a shared library, you will find that using
floats and doubles in calculations can cause gcc to try to use space in
your BSS segment, which will cause lots of trouble, since you aren't
allowed to have a BSS segment in a library. I've dealt with this by using
system traps calls for all my floating point calculations, and have had no
problems since. I don't know if this would be an issue with NewFLoatMgr or
not.

Anyway, some of the utilities and code that I've gathered (mostly) and
written can be found at http://www.emmgraphics.com/pilot (usually with
references to the folks who actually figured out the hard stuff.)

Good luck,

-jim berry

Reply via email to