Re: A newbie question

sali0090_at_tc.umn.edu
Date: 01/26/05


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



Relevant Pages

  • Re: [9fans] new compilers
    ... unbundled the C compiler. ... Sun is as responsible for GCC as the ... AT&T lawyers are responsible for Linux. ... Sun compilers were ready to outrun the GNU bloatationiousness. ...
    (comp.os.plan9)
  • Re: [F77] storing bytes data
    ... port on the Sun with a different compiler and it wasn't ... The code does work with current Sun compilers, ... which support 1-byte integers fine. ... When I had to do this in f77 days, I broke down and made it ...
    (comp.lang.fortran)