Re: A newbie question
sali0090_at_tc.umn.edu
Date: 01/26/05
- Next message: FX: "Re: 6 gfortran bugs"
- Previous message: Kobrinsky: "[Fortran77] stops writing files"
- Next in thread: Richard E Maine: "Re: A newbie question"
- Reply: Richard E Maine: "Re: A newbie question"
- Reply: Steve Lionel: "Re: A newbie question"
- Maybe reply: ayagnam_at_gmail.com: "Re: A newbie question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 25 Jan 2005 22:52:51 -0800
My definition of a smart Fortran95 compiler
Real*8 :: number
number = 1e-8 * 1e16 / 2.0 + 4e3 + 1 - sqrt(2)
==>
number = real(1e-8,8) * real(1e16,8) / real(2.0,8) + real(4e3,8) +
real(1.0,8) - sqrt(real(2.0,8))
where sqrt is the overloaded double precision intrinsic function.
Both the Intel and Sun compilers do this. Any compiler that does not
do this should be doing this. There is no reason to degrade precision
upon assignment.
It also makes life easier for engineers and scientists who use
mathematics daily and see 1 x 10^N as 1eN and not 1d0N or whatever
Fortran77 used.
-Howard Salis
- Next message: FX: "Re: 6 gfortran bugs"
- Previous message: Kobrinsky: "[Fortran77] stops writing files"
- Next in thread: Richard E Maine: "Re: A newbie question"
- Reply: Richard E Maine: "Re: A newbie question"
- Reply: Steve Lionel: "Re: A newbie question"
- Maybe reply: ayagnam_at_gmail.com: "Re: A newbie question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|