I use the following technique to convert between the two
FlpDouble palmDouble;
double normalDouble;
// To go from Palm double to a normal double
normalDouble = *(double *)&palmDouble;
// To go from a normal double to a Palm double
palmDouble = *(FlpDouble *)&normalDouble;
I hope this helps
Oliver
At 06:06 PM 7/6/99 +0200, you wrote:
>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
>