is real an 80-bit type or not?

Sean Kelly sean at f4.ca
Fri Dec 15 16:50:47 PST 2006


Perhaps they think that "real" should always be a 64-bit type?  There 
are a few different ways that statement could be interpreted.

Bill Baxter wrote:
> That all sounds perfectly reasonable.  So why would that make it onto 
> someone's "top D peeves" list?
> 
> --bb
> 
> Anders F Björklund wrote:
>> Bill Baxter wrote:
>>
>>> I read somewhere (won't say where ;-)) that someone is annoyed by D 
>>> "pretending that "real" is an 80-bit type".  Is it not?  real.sizeof 
>>> sure seems to return 10 for me.
>>
>>
>> It's an 80-bit type on all (make that "both") DMD platforms...
>> It varies on the platforms and architectures that GDC supports.
>>
>> "int" is a fixed 32-bit type, everywhere. "real" varies in size.
>> It's 80-bit on Intel, 64 bits on PowerPC and 128 bits on SPARC ?
>>
>> It's defined as the "largest hardware implemented" float type.
>> Basically since it maps directly onto the "long double" C type.
>>
>> --anders
>>
>> PS. real.sizeof varies between Intel too, due to padding.
>>     But it should be the same x87 format of the registers.
>>
>>     GDC manual says: "On Win32, GDC allocates 12 bytes for
>>     the real type, while DMD allocates 10 bytes."


More information about the Digitalmars-d-learn mailing list