About the REAL constants in iso_fortran_env
Angelo Graziosi
angelo.graziosi@alice.it
Wed Jul 8 23:29:00 GMT 2015
Il 09/07/2015 01:08, Steve Kargl ha scritto:
>
> FX's choice is fine, and actually has a performance consequence.
> The Intel 80-bit extended format has FPU support. The REAL(16)
> type, which is also 128 bits, is a software implementation of
> IEEE binary128.
I know that FX does the right things..
>
> So, to answer the stack overflow question. Learn how to
> use SELECTED_REAL_KIND(P=foo, R=bar) to get exactly what
> you want.
>
All my applications are based on this module (at least since
quad-precision was added to GCC):
module kind_consts
implicit none
private
integer, parameter :: QP = selected_real_kind(30,300)
!integer, parameter :: DP = kind(1.D0)
! DP: Following A. Miller definitions...
integer, parameter :: DP = selected_real_kind(12,60)
integer, parameter :: I1B = selected_int_kind(2)
!integer, parameter :: I8B = selected_int_kind(10)
integer, parameter :: I8B = selected_int_kind(18)
public :: DP, I1B, I8B, QP
end module kind_consts
which over the years it has undergone some evolution, but recently I
have found discussions (as that on stack overflow) in which people uses
REAL?? from iso_fortran_env module to define precision. Some test case
suggested that something does not add up..
Thanks for the detailed explanation.
Angelo
More information about the Fortran
mailing list