Jump to page: 1 2
Thread overview
is real an 80-bit type or not?
Dec 15, 2006
Bill Baxter
Dec 15, 2006
Sean Kelly
Dec 16, 2006
Bill Baxter
Dec 16, 2006
Sean Kelly
Dec 16, 2006
Frits van Bommel
Dec 16, 2006
Bill Baxter
Dec 17, 2006
Don Clugston
Dec 19, 2006
Don Clugston
Dec 18, 2006
Bill Baxter
Dec 19, 2006
Benji Smith
December 15, 2006
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.

--bb
December 15, 2006
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 is with DMD.  I'm not sure if GDC uses 80 or 64-bit reals on the x86.


Sean
December 15, 2006
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."
December 16, 2006
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."
December 16, 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."
December 16, 2006
Sean Kelly wrote:
> Perhaps they think that "real" should always be a 64-bit type?  There are a few different ways that statement could be interpreted.

Or they're just mathematical purists who don't think a type named 'real' should have finite precision and range :p.
Of course, then they'd have to complain about 'int' being limited to -2^31..2^31-1 too.
And let's not get into ireal and creal...
December 16, 2006
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.

>> "int" is a fixed 32-bit type, everywhere. "real" varies in size.

> That all sounds perfectly reasonable.  So why would that make it onto someone's "top D peeves" list?

In my case it's on my pet peeves list because of the "it's 10 for me".
So you have hardcoded assertions that real.sizeof > double.sizeof...

Kinda like the "if (Win32) else //linux ;", it's making assumptions.
They are valid for DMD, but break for GDC - and make porting harder ?

But most of all I dislike the "imaginary real" and the "complex real".
(see http://www.digitalmars.com/d/archives/digitalmars/D/18061.html)

Since it's not going to change anyway, I'm OK with coping with it...
But still think the 16-bit and 128-bit types would have been nice ?

--anders
December 16, 2006
Anders F Björklund wrote:
> Bill Baxter wrote:
> 
> In my case it's on my pet peeves list because of the "it's 10 for me".
> So you have hardcoded assertions that real.sizeof > double.sizeof...
> 
> Kinda like the "if (Win32) else //linux ;", it's making assumptions.
> They are valid for DMD, but break for GDC - and make porting harder ?
> 
> But most of all I dislike the "imaginary real" and the "complex real".
> (see http://www.digitalmars.com/d/archives/digitalmars/D/18061.html)
> 
> Since it's not going to change anyway, I'm OK with coping with it...
> But still think the 16-bit and 128-bit types would have been nice ?

I see.  So really it's nothing particular to D.  More with D users, and even then, users making assumptions about platforms is far from unique to D.  Glad to know it's nothing seriously wrong with D's 80-bit math on platforms that have it.

--bb
December 17, 2006
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.
> 
>>> "int" is a fixed 32-bit type, everywhere. "real" varies in size.
> 
>> That all sounds perfectly reasonable.  So why would that make it onto someone's "top D peeves" list?
> 
> In my case it's on my pet peeves list because of the "it's 10 for me".
> So you have hardcoded assertions that real.sizeof > double.sizeof...
> 
> Kinda like the "if (Win32) else //linux ;", it's making assumptions.
> They are valid for DMD, but break for GDC - and make porting harder ?
> 
> But most of all I dislike the "imaginary real" and the "complex real".
> (see http://www.digitalmars.com/d/archives/digitalmars/D/18061.html)
> 
> Since it's not going to change anyway, I'm OK with coping with it...
> But still think the 16-bit and 128-bit types would have been nice ?

It is a bit weird that D has 'cent' and 'ucent' as reserved words, but not 'quadruple'.
December 17, 2006
"Don Clugston" <dac@nospam.com.au> wrote in message news:em43j6$7tl$1@digitaldaemon.com...

> It is a bit weird that D has 'cent' and 'ucent' as reserved words, but not 'quadruple'.

I'd hope it'd be just "quad" :S  "quadruple" is a little lengthy.


« First   ‹ Prev
1 2