From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1732 invoked by alias); 10 Aug 2004 15:24:25 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 1719 invoked from network); 10 Aug 2004 15:24:23 -0000 Received: from unknown (HELO web52701.mail.yahoo.com) (206.190.39.152) by sourceware.org with SMTP; 10 Aug 2004 15:24:23 -0000 Message-ID: <20040810152423.18110.qmail@web52701.mail.yahoo.com> Received: from [131.123.234.136] by web52701.mail.yahoo.com via HTTP; Tue, 10 Aug 2004 08:24:23 PDT Date: Tue, 10 Aug 2004 15:24:00 -0000 From: ew fgff Subject: Problem with double precision in g77 To: gcc-bugs@gcc.gnu.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2004-08/txt/msg00816.txt.bz2 List-Id: Hi, I am using RedHat 9.0 with gcc 3.2 on AMD. I wrote a very simple program which is given below: ************** implicit double precision(a-z) open(7,file='test.dat',status='old') do 10 i = 1, 21 read(7,*)a n = 0.2d0 p = (0.1d0 + n) if(a .eq. p)then print*,a endif 10 continue close(7) end ***************** The data file test.dat contains ***************** 0. 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1. 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2. ******************** The program simply reads the data file and writes if the "if" condition is satisfied. There is no problem in compilation with g77 and f77. When I change the value of "n" from 0 to 0.1, it prints correct values. But when I put n = 0.2, it does not print any output. Similarly it does not print output for n = 0.7 while it prints for other values. It prints correctly for all values of "n" if I remove the "if" condition. It prints correctly all values if I remove double precision even with "if" condition. I checked this program on RedHat 9.0 gcc 3.2 on Pentium IV, SUSI on Pentium IV also. Same things happened. Could you please tell what the problem is. Thank you very much. Manoj Gupta __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com