[Discuss] Test for positive gives wacko results for underflowed values for the gcc compiler suite (including the gcc compiler, and g77 and gfortran compilers)

pw p.willis at telus.net
Mon Jun 25 14:12:05 PDT 2007


Alan W. Irwin wrote:
> Is this a gcc (and g77 and gfortran) issue?  I would appreciate it if
> somebody would run the above C test codes with different C
> compilers/platforms.
> 
> Alan


I get the same thing.

Intel core duo:

gfortran -v
Using built-in specs.
Target: i386-pc-mingw32
Configured with: ../trunk/configure --prefix=/mingw 
--enable-languages=c,fortran --with-gmp=/home/coudert/local 
--disable-nls --with-ld=/mingw/bin/ld --with-as=/mingw/bin/as 
--disable-werror --enable-bootstrap --enable-threads 
--build=i386-pc-mingw32 --disable-shared --enable-libgomp
Thread model: win32
gcc version 4.3.0 20070522 (experimental)


gfortran test.for -ffixed-line-length-none -pedantic -std=f95 -Wall -o 
test.exe


       DOUBLE PRECISION x, xscale
       x = 1.d-200
       xscale = 1.d+250
       write(*,'(1p3d15.5)') x, xscale, x/xscale
       write(*,*) x/xscale.gt.0.d0
       write(*,*) x/xscale.gt.1.d-305
       write(*,*) log(x/xscale)
       end

test.exe

     1.00000-200    1.00000+250    0.00000D+00
  T
  F
                -Infinity





More information about the Discuss mailing list