GDC release 0.23

Anders F Björklund afb at algonet.se
Wed Mar 7 09:28:25 PST 2007


Don Clugston wrote:

>> Older versions of PPC operating systems used 64-bit for "long double",
>> newer versions use 128-bit. Both are still in use, so we won't know.
> 
> Ugh. That's really horrible.

It's called progress :-)

>> And since the D "real" type simply maps over to C/C++ "long double",
>> it means that it will be either 64-bit, 80-bit or 128-bit. Varying.
> 
> We've got to keep that piece of lunacy out of D somehow. Could we define 
> it as __longdouble or something? (Ideally only for PPC, so that error 
> messages remain sensible on other platforms).
> 
> At least in D, we can static-if an alias or typedef on the basis of 
> mant_dig.

I'll let David decide which one wins: D real === C long double, or
the definition of "largest hardware implemented floating point size"


But that that real.sizeof varies between D platforms, that is in the
very definition of the type. (similar to how int used to work, 16/32)

It'll be 10/12/16 bytes on Intel, and 8/16 on those other CPU types.
(i.e. 80-bits with padding on X86/x86_64, and 1 or 2 doubles on PPC)

--anders


More information about the D.gnu mailing list