Re: arbitrary precision
- From: Lurkos <lurkos.usenet@xxxxxxxxx>
- Date: Tue, 4 Oct 2011 18:12:52 +0200
*Wolfgang Kilian* wrote:
Don't forget the GNU projects: GMP/MPFR/MPC
That's right and probably the better solution. However I couldn't find a
Fortran interface. Are you aware of some projects?
These are C libraries, but since they are requirements of the gcc
compiler suite, they may actually be automatically available when you
are using gfortran (some gfortran expert may correct me).
program precreal
implicit none
integer,parameter :: p4 = selected_real_kind(p=6)
integer,parameter :: p8 = selected_real_kind(p=15)
integer,parameter :: p10 = selected_real_kind(p=18)
integer,parameter :: p16 = selected_real_kind(p=33)
integer,parameter :: p32 = selected_real_kind(p=66)
print *, p4
print *, p8
print *, p10
print *, p16
print *, p32
endprogram precreal
Output with gfortran 4.6:
4
8
10
16
-1
It seems not possible to go beyond quadruple precision in a simple way.
By the way, what is the standard return value of HUGE, EPSILON etc. if
the KIND happens to be arbitrary-digits/arbitrary-precision ...? (I
guess that's just theory right now)
That is interesting. Actually I think this is dependent on how much
digits you take, but I don't know if they are implemented also in
arbitrary precision libraries.
--
Lurkos
.
- Follow-Ups:
- Re: arbitrary precision
- From: Wolfgang Kilian
- Re: arbitrary precision
- References:
- Re: arbitrary precision
- From: Wolfgang Kilian
- Re: arbitrary precision
- Prev by Date: Re: ANINT for large doubles with Intel Fortran
- Next by Date: Fortran LinkedIn group
- Previous by thread: Re: arbitrary precision
- Next by thread: Re: arbitrary precision
- Index(es):