From: kern@misstick.inria.fr (Michel Kern)
Subject: Re: double prec. bug in g77?
Date: 1995/10/30 [thread overview]
Message-ID: <472m2g$hea@news-rocq.inria.fr> (raw)
In-Reply-To: DH9DyJ.KG@cyf-kr.edu.pl
In article <DH9DyJ.KG@cyf-kr.edu.pl>, grzes@twins.pk.edu.pl (Grzegorz Mucha) writes:
|> I'm running g77-0.5.16/gcc-2.7.0 on DEC Alpha running DU 3.2.
|> And I found sth. strange:
|>
|> Output from:
|>
|> (111)|alpha:~/FORTRAN> more test1.f
|> program test1
|> a=1.5
|> write(*,*)'a = ',a
|> b=1.5e2
|> write(*,*)'b = ',b
|> end
|>
|> is:
|> (113)|alpha:~/FORTRAN> a.out
|> a = 1.5
|> b = 150.
|>
|> but when I change the program to:
|>
|>
|> double precision a,b
|> a=1.5
|> write(*,*)'a = ',a
|> b=1.5e2
|> write(*,*)'b = ',b
|> end
|>
|> all I get is:
|> (113)|alpha:~/FORTRAN> a.out
|> a = 0.
|> b = 0.
|>
|> and the question is as usual: what's going on?
Well, let me try to answer, and ask some more questions :)
I had this problem, and somehow figured out it had to do with the gcc
macro REAL_ARITHEMTIC, which tells gcc how to preform floating point
computations on the target machine. It turns out that, as distributed,
this macro is defined in config/alpha/alpha.h
I've undefined it, and everything seems to work fine. That is, your
example, as well as other things involving double precision works.
Of course, other things are broken, notably complex arithmetic...
Now, I don't really understand what is going on here. In particular,
why would REAL_ARITHMETIC be defined by default, as this mesnd do all
double operations in software ? Is that the right fix for the problem
Grzegorz is describing ? And why am I doping this anyway :)
Michel
--
Michel KERN | Tel. (33) (1) 39 63 58 41
INRIA Rocquencourt | E-mail: Michel.Kern@inria.fr
78153 Le Chesnay Cedex |
FRANCE |
prev parent reply other threads:[~1995-10-30 5:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1995-10-30 5:00 double prec. bug in g77? Grzegorz Mucha
1995-10-30 5:00 ` Michel Kern [this message]
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