From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,155625553f3258ac X-Google-Attributes: gidfee84,public From: kern@misstick.inria.fr (Michel Kern) Subject: Re: double prec. bug in g77? Date: 1995/10/30 Message-ID: <472m2g$hea@news-rocq.inria.fr>#1/1 X-Deja-AN: 118391781 references: content-type: text/plain; charset=iso-8859-1 organization: I.N.R.I.A., Rocquencourt mime-version: 1.0 reply-to: Michel.Kern@inria.fr newsgroups: comp.unix.osf.osf1 In article , 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 |