Article View: gnu.gcc.bug
Article #2735gcc-1.35 - constant floating point bug
From: Andrew Thomas
Date: Tue, 06 Jun 1989 23:16
Date: Tue, 06 Jun 1989 23:16
29 lines
1026 bytes
1026 bytes
I am running a uVax II with Ultrix 2.0, gcc-1.35. I have seen reports
for this bug before, and I am wondering if there is a simple fix.
The following program generates the error noted below it:
-----------------------
main()
{
float x;
x=1;
printf ("%g\n",x);
}
gccbug.c:4: Magnitude of constant too large for 'float'
--------------------------------
The same behaviour occurs if line 4 is changed to x=1.0. This can be
circumvented if I say:
int y = 1;
x = y;
But what happens when I want x=1.5 ?
--
Andrew Thomas
andrewt@watsnew.waterloo.edu Systems Design Eng. University of Waterloo
Technical Details
Message-ID:
<ANDREWT.89Jun6191645@watsnew.waterloo.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!watmath!watcgl!andrewtShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!watcgl!andrewt From: andrewt@watsnew.waterloo.edu (Andrew Thomas) Newsgroups: gnu.gcc.bug Subject: gcc-1.35 - constant floating point bug Message-ID: <ANDREWT.89Jun6191645@watsnew.waterloo.edu> Date: 6 Jun 89 23:16:46 GMT Sender: daemon@watcgl.waterloo.edu Distribution: world Organization: University of Waterloo, Waterloo, Ontario, Canada Lines: 29