This is the mail archive of the gcc-bugs@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]

Re: c++/3005


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


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