tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
* [SUMMARY] f90: double precision constants
@ 1998-06-16  8:06 Gerhard Nolte
  0 siblings, 0 replies; only message in thread
From: Gerhard Nolte @ 1998-06-16  8:06 UTC (permalink / raw)
  To: tru64-unix-managers

Dear Gurus,

I asked:

   on Digital Unix 4.0d the F90 compiler (DFABASE500) shows an unexpected
   behaviour: assigning a constant to a double precision variable is
   sensitive in respect to the d0-appendix (see small example
   program). f77 has the expected behaviour. Is it a bug or a feature of
   f90?

          8< ---------------- cut here -------------------- >8
      program Double_precision_test

C Gibt's einen Unterschied zwischen unter f90 zwischen den Konstanten
C mit und ohne d0 Appendix?

      double precision x, xd0

      x   = 1.23456
      xd0 = 1.23456d0

      print*, '  x =', x
      print*, 'xd0 =', xd0

      print*, ' x-xd0 = ', x - xd0

      end
          8< ---------------- cut here -------------------- >8

The opinion of the majority was that a constant without d0-appendix isn't
of type double precision and hence has a different internal representation 
than the same constant with d0 appendix. Therefore the behaviour of the  f90 
compiler is a feature.

Thanks to 
Burch Seymour RTPS <bseymour@encore.com>
"Dr. Tom Blinn, 603-884-0646" <tpb@zk3.dec.com>
Jerome M Berkman <jerry@uclink.berkeley.edu>
Ian Mortimer <mortimer@physics.uq.edu.au>

Gerhard

-- 
Gerhard Nolte
Email: gnolte@gwdg.de   Voice: +49-551-5176-716  Fax: +49-551-5176-704
MPI fuer Stroemungsforschung, Bunsenstr. 10, 37073 Goettingen, Germany

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1998-06-16  8:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-06-16  8:06 [SUMMARY] f90: double precision constants Gerhard Nolte

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox