This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
Re: other/5580: double
- From: Richard Henderson <rth at redhat dot com>
- To: nobody at gcc dot gnu dot org
- Cc: gcc-prs at gcc dot gnu dot org,
- Date: 5 Feb 2002 09:06:08 -0000
- Subject: Re: other/5580: double
- Reply-to: Richard Henderson <rth at redhat dot com>
The following reply was made to PR other/5580; it has been noted by GNATS.
From: Richard Henderson <rth@redhat.com>
To: x-tronic@ji.cz
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: other/5580: double
Date: Tue, 5 Feb 2002 01:02:30 -0800
On Sun, Feb 03, 2002 at 01:04:01PM -0000, x-tronic@ji.cz wrote:
> double d1=40/12;
> double d2=40/12.00;
>
> d1 is 3 (???)
> d2 is 3.333 (as it should)
Not a bug. This is
double d1 = (double)((int)40 / (int)12);
not
double d1 = (double)40 / (double)12;
r~