From: "John Harper" <[log in to unmask]>
Sent: Friday, April 26, 2013 12:05 PM
> On Thu, 25 Apr 2013, Neil Carlson wrote:
>
>> Date: Thu, 25 Apr 2013 17:55:15 -0600
>> From: Neil Carlson <[log in to unmask]>
>> Reply-To: Fortran 90 List <[log in to unmask]>
>> To: [log in to unmask]
>> Subject: Re: How to select double precision
>>
>> Interesting. Do you know how the compiler stores values of that type in
>> memory?
>> Are they packed into consecutive 10-byte chunks, or are they padded out to
>> 16-bytes
>> (or something else)?
>>
>> On Thu, Apr 25, 2013 at 5:31 PM, John Harper <[log in to unmask]> wrote:
>>
>>> On Thu, 25 Apr 2013, Neil Carlson wrote:
>>>
>>> In the end, whatever precision/range you request is going to be mapped
>>>> to 32-bit, 64-bit, or 128-bit. That's today's reality, and I don't see it
>>>> changing,
>>> What about 80-bit? The program below compiles and runs with either g95
>>> or gfortran on an x86_64 linux system, with the output you see under it.
>>>
>>> real(10) x
>>> print "(6(1X,I0))",minexponent(x),maxexponent(x),range(x), &
>>> digits(x),precision(x),radix(x)
>>> print "(ES26.17E4)",epsilon(x),huge(x),tiny(x)
>>> end
>>>
>>> -16381 16384 4931 64 18 2
>>> 1.08420217248550443E-0019
>>> 1.18973149535723177E+4932
>>> 3.36210314311209351E-4932
>
> I am under the impression they use the x86 method described in
> http://en.wikipedia.org/wiki/Extended_precision which requires 80
> bits; the kind is 10 because it uses 10 8-bit bytes.
No, the kind number is whatever the compiler uses, and it isn't necessarily 10.
|