This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
c++/10566: simple, but big problem
- From: ftomaz at ualg dot pt
- To: gcc-gnats at gcc dot gnu dot org
- Date: 30 Apr 2003 15:32:31 -0000
- Subject: c++/10566: simple, but big problem
- Reply-to: ftomaz at ualg dot pt
>Number: 10566
>Category: c++
>Synopsis: simple, but big problem
>Confidential: no
>Severity: critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: wrong-code
>Submitter-Id: net
>Arrival-Date: Wed Apr 30 15:36:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: ftomaz@ualg.pt
>Release: gcc (GCC) 3.2.2 (Mandrake Linux 9.1 3.2.2-3mdk)
>Organization:
>Environment:
Linux Mandrake 9.1 (final)
>Description:
See the output of both lines of code:
1) Bad
cout << (double) floor ( double ( 8.075 * 100 + 0.5 ) ) << endl;
it outputs 807, but (8.075 * 100 + 0.5) = 808. Using this argument in the same code it is good (see below)
2) Ok
cout << (double) floor ( double ( 808 ) ) << endl;
it outputs 808 ... no comments ...
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: