real128 cmplx ATAN, ATANH - quality of implementation?

Dan Nagle danlnagle@me.com
Fri Feb 3 22:38:00 GMT 2017


Hi,

> On Feb 3, 2017, at 14:02 , Steve Kargl <sgk@troutmask.apl.washington.edu> wrote:
> 
> On Fri, Feb 03, 2017 at 05:19:51PM +0100, FX wrote:
>>> No, it is not.  Anton uses x86_64-*-free.  REAL128 maps to REAL(10)
>>> aka long double complex.  Note, that the standard says that REAL128
>>> corresponds with a type that occupies 128 bits, which REAL(10) does
>>> on FreeBSD (long double is padded for 16-byte alignment).
>> 
>> Even on other platforms it often does. I had forgotten that.
>> 
> 
> I suspect some users will see REAL128 and think that this maps
> to an IEEE754-2008 128-bit floating point type with 113-bits of
> precisions.  This patch will cause gfortran to select the
> kind type with the larget precision.  Testing on x86_64-*-freebsd
> with the following program
> 
> program foo
>   use iso_fortran_env
>   print '(3(I0,1x))', kind(1._REAL32), kind(1._REAL64), kind(1._REAL128)
> end program foo
> 
> gives '4 8 10' without the patch and '4 8 16' with the patch.
> 
> What do you think? Should we adopt the patch?
> 

Yes, this is a surprise when it arises in my Fortran workshops.
real128 gives REAL*10 is unexpected by many.

Thanks, Steve.

--

Cheers!
Dan Nagle






More information about the Fortran mailing list