CompuServe Messages

#Unions

    18-Dec-94 08:34:03
Sb: #Unions
Fm: Shraddhan 70374,754
To: All
I wold like to have a convenient way of handling double floats so that I can refer to them either as a double float or as two long words, without constant type-casting. I have tried using: #define High 0 #define Low 1 union DoubleFloat { double dp; // A double float number long DP[2]; // The same number as two longs }; struct DoubleFloat ValDPFloat; but I find that ValDPFloat.DP[High] is stored _after_ ValDPFloat.dp rather than at the same address, thus defeating the whole point. I am using DICE. Is this a problem with DICE or with me? Regards, Shraddhan (via AP from Hertfordshire, England)