Floating point precision on 64bit arch

Hi,

what is the maximal floating point precision I can get with the 64bit version of the Fortran compiler?
I couldn’t find the answer in the specs or FAQs (and I’m pretty new to high precision numerics)

Thanks
Tom

Hi Tom,

PGI supports DOUBLE PRECISION (aka REAL*8) data types which have a precision of 15 decimal points and a range of +/-10^307. You can use the Fortran “precision” and “range” intrinsic to determine the values for any given real or complex variable. For example:

% cat test.f90
real*8 :: x
real*4 :: y
print *, precision(x), range(x)
print *, precision(y), range(y)
end
% pgfortran test.f90
% a.out
           15          307
            6           37

Hope this helps,
Mat

Hi Mat,

thanks for the answer…
That means, unfortunately, that the compiler doesn’t support real*16 (quadruple). I have huge cancellations in my computations and will definitely need this precision.

Are there plans to include real*16?
Doesn’t the current 64bit hardware support quadruple precision natively anyway?

Cheers,
Tom

Hi Tom,

Doesn’t the current 64bit hardware support quadruple precision natively anyway?

No. They support 2 simultaneous 64-bit operations but not 128-bit data types.

So this means either implement REAL10 using 80-bits (on the x87) and call it REAL16 (as some compilers do), or implement it using software emulation (with very poor performance). Neither choice is very good.

Are there plans to include real*16?

It will happen at some point, but currently there are no firm plans to add it.

  • Mat