public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/3005
@ 2001-06-03 2:41 lerdsuwa
0 siblings, 0 replies; only message in thread
From: lerdsuwa @ 2001-06-03 2:41 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, mvishnu, nobody
Synopsis: improper evaluation of mixed mode expressions involving long long
State-Changed-From-To: open->closed
State-Changed-By: lerdsuwa
State-Changed-When: Sun Jun 3 02:41:08 2001
State-Changed-Why:
Not a bug. The expression n*424*1000000/mi is computed as
((n*424)*1000000)/mi. The subexpression (n*424)*1000000
involves only 'int' quantities and therefore it is evaluated
using 'int' precision. The errornous result is then
converted to unsigned long long when dividing by 'mi'.
To get the desired behavior, cast 'n' to unsigned long long.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=3005&database=gcc
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2001-06-03 2:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-03 2:41 c++/3005 lerdsuwa
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).