[RFC] Quad-float support, round 4

Angelo Graziosi angelo.graziosi@alice.it
Tue Sep 14 16:55:00 GMT 2010


Il 14/09/2010 9.29, FX ha scritto:
>> I have tried the same on Cygwin but...
>>
>> $ gcc-4.6 -x c -E timing.pf90 -o timing.f90&&  gfortran-4.6 -ffree-line-length-none -fno-whole-file timing.f90 -L/tmp/libquad/lib -lgfortran -lquad -lm -O2&&  ./a.exe
>>
>> /tmp/ccwu3X12.o:timing.f90:(.text+0x8c4): undefined reference to `_sinl'
>> /tmp/ccwu3X12.o:timing.f90:(.text+0xe84): undefined reference to `_cosl'
>> /tmp/ccwu3X12.o:timing.f90:(.text+0x1444): undefined reference to `_asinhl'
>> /tmp/ccwu3X12.o:timing.f90:(.text+0x1a04): undefined reference to `_erfcl'
>
> Cygwin doesn't have long double, a.k.a. real(kind=10), math library support. Remove all lines that use this kind value.

Hmm... perhaps I am missing something...

$ cat test_qp.f90
program test_qp
   implicit none
   integer, parameter :: QP = 10
   real(QP), parameter :: Z1 = 1,HALF_PI = asin(Z1),PI = HALF_PI+HALF_PI
   real(QP) :: x = 0.124_QP
   print *, x
   print *, PI
   print *, 16*atan(0.2_QP)-4*atan(Z1/239)
   print *, sin(PI)
   print *, cos(HALF_PI)
   print *, asinh(PI)
   print *, erfc(Z1)
   print *, epsilon(x)
   print *, precision(x)
   print *, digits(x)
end program test_qp

(notice QP == 10 :-))

$ gfortran test_qp.f90 -o test_qp-kind_10
$ ./test_qp-kind_10
   0.12400000000000000000
    3.1415926535897932385
    3.1415926535897932385
  -5.01655761266833202345E-0020
  -2.50827880633416601173E-0020
    1.8622957433108482199
   0.15729920705028513066
   1.08420217248550443401E-0019
           18
           64

gfc being 4.3.4

if QP == 16,

$ gfortran-4.6 -static test_qp.f90 -o test_qp-kind_16 -L/tmp/libquad/lib 
-lgfortran -lquad

$ ./test_qp-kind_16
   0.12399999999999999999999999999999999
    3.1415926535897932384626433832795028
    3.1415926535897932384626433832795032
   8.67181013012378102479704402604335225E-0035
   4.33590506506189051239852201302167613E-0035
    1.8622957433108482198883613251826206
   0.15729920705028513065877936491739074
   1.92592994438723585305597794258492732E-0034
           33
          113


Ciao,
Angelo.



More information about the Fortran mailing list