BTW, I am using gcc not CW.

On Mon, 12 Apr 1999, Elia J. Freedman wrote:

> Fast answer:
> 1.  You can compile apps with float and double in them because the desktop
> operating system and Codewarrior's app knows them from ANSII programming.
> If you try to run it on the device, it should crash.
> 2.  Don't read the header file -- it is confusing.  The functions listed are
> OS traps and other intermediate functions that make it work.  You are
> looking into this too deeply.

I'm sure I am.  But that's what I have to do to learn.  I have a small
app working and I do use NewFloatMgr.  But please bear with me a little
longer.
 
> It is simple:
> double y, x, z;
> y = 2.5
> x = 1.25;
> z = y + z;

You say (1 above) that "you can compile with float and double...on the
device it should crash".  How does NewFloatMgr resolve this problem so
that you can add, like your example above, when NewFloatMgr does not 
even make use of float or double except in the FlpCompDouble and
FlpCompFloat and then never uses those members?

Also the FlpCompFloat has a float member (f) and the FlpCompDouble has a
double member(d).  But all the NewFloatMgr functions require FlpDouble or
FlpFloat parameters and return FlpDouble or FlpFloat values.  So, what is
the point of having the double (d) or float (f) members of the union?

I do see that somehow one way or the other, a float or double number will
eventually be displayed or retrieved from a form and that will require one
of the FlpAToF functions, which also requires the use of FlpFloat which is
in FlpCompDouble.  So, in that respect I see some use of NewFloatMgr.

But I am still at a loss to see why it is necessary or how it resolves the
ability to do:

double x,y,z;
y=9.2;
z=8.1;
x = y + z;

If this CAN be done without NewFloatMgr, then I don't see why it is
required.  If this CANNOT be done without NewFloatMgr, then I don't see
the mechanism that permits it.  I use gcc not CW.


> To convert to a string using Palm's notation, you have to use FlpCompDouble.
> For instance,
> FlpCompDouble item;
> Char  blah[ ];
> item.d = x;
> StrFToA(blah, item.fd);

Actually, this one I pretty much understand.  It's about the only way
to get a float from a form to a variable in the program.

> Elia
> 
> -----Original Message-----
> From: Michael S. Davis [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 12, 1999 3:55 PM
> To: [EMAIL PROTECTED]
> Subject: Re: NewFloatMgr: Never Got Answer
> 
> 
> On Mon, 12 Apr 1999, Dave Lippincott wrote:
> 
> > I believe you need to use the NewFloatMgr if you wish to use doubles and
> > floats.  The old way used structures and function calls to do floating
> point
> > math.
> 
> Now I'm more confused than ever.  I thought I knew HOW to use NewFloatMgr
> but I was confused by why it was necessary but...
> 
> This does not seem right. That IS what I thought the reason was but
> there are float and double types available without using NewFloatMgr.  And
> MathLib library uses doubles and floats to provide functions and it does
> not use NewFloatMgr.
> 
> So, that is what is confusing to me.
> 
> > Old way to add two floats:
> > FloatType Answer,a,b;
> >
> > Answer = FplAdd(a, b);
> >
> > New way:
> > float answer,a,b;
> >
> > answer = a + b;
> 
> I don't think this uses NewFloatMgr at all does it?  The header for the
> NewFloatMgr says to use _f_add().  NewFloatMgr uses structures same as
> old way.
> 
> Maybe I need float 101 class.
> 
> Anyone else want to take a stab at explaining why NewFloatMgr is needed?
> Maybe examples of what you can and cannot do?  Aren't double and float
> available already in gcc.  I created a new project with NO NewFloatMgr.h
> included and declared two variable types of float and double.  It compiled
> fine and I did not need NewFloatMgr.
> 
> I'm sure there is a good reason to use it but I don't see why it is
> necessary.  Detailed explanation anyone?  I have also looked at apps
> that don't use NewFloatMgr that do use float and double types.
> 
> > I'd use the NewFloatMgr simply because it is the way I'm use to working
> with
> > floating point numbers. The only drawback is there are no direct routines
> or
> > support to format and convert floats to strings.
> >
> > -----Original Message-----
> > From: Michael S. Davis <[EMAIL PROTECTED]>
> > To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
> > Date: Monday, April 12, 1999 4:40 PM
> > Subject: NewFloatMgr: Never Got Answer
> >
> >
> > >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
> > >
> > >----------------------------------------------------
> > >Shoot-to-Win
> > >
> > >Protect the 2nd Amendment
> > >----------------------------------------------------
> > >
> > >
> > >
> >
> >
> >
> >
> 
> ----------------------------------------------------
> Shoot-to-Win
> 
> Protect the 2nd Amendment
> ----------------------------------------------------
> 
> 
> 
> 
> 

----------------------------------------------------
Shoot-to-Win

Protect the 2nd Amendment
----------------------------------------------------

Reply via email to