This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: other/5580: double


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~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]