This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: How to use "long double" real(kind=10) ?
- From: FX Coudert <fxcoudert at gmail dot com>
- To: Thomas Baruchel <baruchel at free dot fr>
- Cc: fortran at gcc dot gnu dot org
- Date: Wed, 22 Feb 2006 00:17:06 +0100
- Subject: Re: How to use "long double" real(kind=10) ?
- References: <dtfooe$7d5$1@sea.gmane.org>
Salut !
With a previous version of gfortran, I remember having used
real(kind=10)
with no problem. But with a more recent version, I can't use
that any longer. How can I use the "long double" type?
First, it depends for what target you're compiling. On i686-linux,
i686-cygwin, x86_64-linux for example, you can simply use the
following:
real(kind=10) :: x, y
x = -1.0_10
y = acos(x)
write(*,"(G40.30)") y
end
$ gfortran a.f90
$ ./a.out
3.14159265358979323851280900000
If you're talking about i686-mingw32 (also called, on the gfortran
wiki, "native windows"), then the support for real(kind=10) is not
present anymore on the distributed binaries: I had to remove it because
the Windows I/O system calls for long double are broken.
Finally, if you experience any trouble, please report the target and
compiler version (that is, the output of "gfortran -v"), as well as the
way you got the binaries (ou built them).
FX