From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <199610171659.MAA19307@churchy.gnu.ai.mit.edu> Date: Thu, 17 Oct 1996 12:59:51 -0400 From: Craig Burley Subject: Re: Fortran compiler for Linux/Alpha >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