This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
I can't get the attached program to work with double precision (kind=8). If I set working precision to 4 (see attached code) I get the correct results with gfortran: 0.1000000 2.991917 0.2000000 2.967996 0.3000000 2.929212 0.4000000 2.877139 0.5000000 2.813868 0.6000000 2.741907 0.7000000 2.664046 0.8000001 2.583202 0.9000001 2.502252 1.000000 2.423863 Intel ifort gives: wrong 0.1000000 3.115738 0.2000000 3.216358 0.3000000 3.299795 0.4000000 3.364530 0.5000000 3.409596 0.6000000 3.434577 0.7000000 3.439587 0.8000001 3.425236 0.9000001 3.392583 1.000000 3.343084 With wp=8, gfortran and ifort give: 0.100000000000000 NaN 0.200000000000000 NaN 0.300000000000000 NaN 0.400000000000000 NaN 0.500000000000000 NaN 0.600000000000000 NaN 0.700000000000000 NaN 0.800000000000000 NaN 0.900000000000000 NaN 1.00000000000000 NaN I am using gfortran: Reading specs from /home/jerry/usr/lib/gcc/i686-pc-linux-gnu/4.0.0/specs Configured with: ../gcc/configure --prefix=/home/jerry/usr --enable- languages=c,f95 : (reconfigured) ../gcc/configure -- prefix=/home/jerry/usr --with-gcc-version- trigger=/home/jerry/build/gcc/gcc/version.c --enable-languages=c,f95 -- no-create --no-recursion Thread model: posix gcc version 4.0.0 20041121 (experimental) Program attached. Thanks Jerry
Attachment:
rk4.f90
Description: Text document
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |