FlpCompDouble flpX;
double x = 3.1415;

flpX.d = 3.1415;
FlpFToA(flpX.fd, ... );

Elia

-----Original Message-----
From: Danko Radic [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 06, 1999 9:06 AM
To: 3com Palm Pilot Developers Forum
Subject: How to make FlpDouble from double


Hm, I started to play with NewFloatManager (so far using just ie. float a;
type worked well). SampleCalc describes well how to create FlpDouble and
FlpCompDouble variables *from* string. But, I'd like to do vice versa and
the most stupid thing came out. I don't know how to create FlpDouble (nor
FlpFloat) type from double (or float) type. Ie. I have
 float a=3.14;
What to do with that? From NewFloatMgr.h it comes:

 typedef SDWord FlpFloat;

and

 typedef _sfpe_64_bits FlpDouble;
 typedef struct {
        SDWord high;
        SDWord low;
 } _sfpe_64_bits;

How to insert float/double type variable into these.
It seems normal procedure with FlpCompDouble since it is:

 typedef union {
        double                          d;
        FlpDouble                       fd;
        DWord                           ul[2];
        FlpDoubleBits   fdb;
 } FlpCompDouble;


so it's just:

 FlpCompDouble b;
 b.d=(double)a;


But I need *FlpDouble* because FlpFToA(FlpDouble b,CharPtr s) operates
over that type and I don't know how to convert FlpCompDouble into
FlpDouble again...


Thanks in advance




Reply via email to