Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Craig Burley <burley@gnu.ai.mit.edu>
Subject: Re: Fortran compiler for Linux/Alpha
Date: Thu, 17 Oct 1996 12:59:51 -0400	[thread overview]
Message-ID: <199610171659.MAA19307@churchy.gnu.ai.mit.edu> (raw)

>Why "float"?  However, the following fortran source fixes the problem:
>
>      c72=DBLE(0.30901699437494742)

The constant is a single-precision floating-point constant.  If you
want double-precision, which looks to be the case given all the digits
you've specified, rewrite the above statement to:

      c72 = 0.30901699437494742d0

The "d0" says "this is a double-precision constant" just like the
appended "l" or "ll" tells C compilers that a constant is long or (for
gcc) long long.  The "d0" makes _all_ standard-conforming Fortran
compilers interpret the constant as double-precision -- without it,
some will interpret it as single-precision and convert it, resulting
in a double-precision value that is likely to differ beyond the precision
offered by single-precision numbers on that machine.

The g77 documentation has a lot more to say about constants, and the
reason g77 doesn't attempt to use context to determine the intended type
of the constant (as some compilers do, leading to inconsistent behavior
in all sorts of cases).

If, after reading that, you have some desire to learn more about the
issue, comp.lang.fortran is a good place.

        tq vm, (burley)

--
To unsubscribe: mail -s unsubscribe axp-list-request@redhat.com < /dev/null

             reply	other threads:[~1996-10-17 16:59 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-10-17 16:59 Craig Burley [this message]
     [not found] <Pine.LNX.3.91.961016103053.15626A-100000@zen.linpro.no>
1996-10-16 21:50 ` Fortran compiler for Linux/Alpha Dwight Hogge
1996-10-16 22:56 ` Scott Locklin ESG
1996-10-21  8:16 ` Nigel Sale
     [not found] <199610180524.BAA08287@rrdjazz.nist.gov>
1996-10-18 12:47 ` Ulf Griesmann
  -- strict thread matches above, loose matches on Subject: below --
1996-10-18  5:24 Przemek Klosowski
1996-10-17 18:25 Toon Moene
1996-10-17 15:44 Michael J. Donahue
     [not found] <199610162150.OAA23968@topanga.arete.com>
1996-10-17 12:15 ` Jim Nance
1996-10-17 17:41   ` Dwight Hogge
1996-10-17 18:39     ` Jim Nance
1996-10-16 23:18 Michael J. Donahue
1996-10-16  8:45 Robert Rødsten
read-only archive

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