Something strange with g77 ...
From: Arjen Markus (arjen.markus_at_wldelft.nl)
Date: 10/27/03
- Next message: Arjen Markus: "Re: Something strange with g77 ..."
- Previous message: Dr Ivan D. Reid: "Re: some confusing in subroutine"
- Next in thread: Arjen Markus: "Re: Something strange with g77 ..."
- Reply: Arjen Markus: "Re: Something strange with g77 ..."
- Reply: David Ham: "Re: Something strange with g77 ..."
- Reply: G.F. Thomas: "Re: Something strange with g77 ..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 27 Oct 2003 15:51:46 +0100
Hello,
I was trying a few things concerning double and single precision.
Can anyone clarify the result I get with this little program
under Linux using g77:
implicit none
real*8 PI, x
parameter (PI = 3.1415926535897932384)
write(*,*) pi
x = pi
call diff(x)
write(*,*) x
stop
end
subroutine diff(x)
real*4 PI4
parameter (PI4 = 3.1415926535897932384)
real*8 x
x = x - pi4
return
end
When I run this, the answer is (note the last two
digits):
3.14159274
0.
When, instead, I use f77 on a Sun/Solaris machine:
3.1415926535898
0.
Much more as I would expect! (even though the exact
zero still puzzles me).
g77 on that Solaris machine gives the same answer
by the way as g77 on Linux.
Regards,
Arjen
- Next message: Arjen Markus: "Re: Something strange with g77 ..."
- Previous message: Dr Ivan D. Reid: "Re: some confusing in subroutine"
- Next in thread: Arjen Markus: "Re: Something strange with g77 ..."
- Reply: Arjen Markus: "Re: Something strange with g77 ..."
- Reply: David Ham: "Re: Something strange with g77 ..."
- Reply: G.F. Thomas: "Re: Something strange with g77 ..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|