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]
Other format: [Raw text]

[Bug c++/29597] log expression returns different results when casting



------- Comment #2 from bangerth at dealii dot org  2006-10-26 06:39 -------
To be more concrete: (int)(expression) rounds down. So if your quotient
of logarithms happens to be computed to 5.999999999999999, then you
will get a result of 5 after casting to int. You should round results,
not just cast them.

W.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29597


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