[Gecode] Testing arithmetic rounding

Guido Tack tack at ps.uni-sb.de
Wed Aug 24 13:20:43 CEST 2005


> As far as I understand, all modern hardware rounds towards zero. If my
> memory serves me right it is event standard for C99 but not yet for C++.
>
> Anybody knows more here...

As I said, I found it in the C++ standard:

4.9 Floating-integral conversions
An rvalue of a floating point type can be converted to an rvalue of an integer 
type. The conversion trun-
cates; that is, the fractional part is discarded. The behavior is undefined if 
the truncated value cannot be
represented in the destination type. [Note: If the destination type is bool, 
see 4.12. ]

> Guido, if you feel its too messy I could remove it, we do not need it
> badly.

As far as I can see, we should remove the test, not the code ;-)

Guido

-- 
Guido Tack
Programming Systems Lab, Saarland University, Saarbrücken
http://www.ps.uni-sb.de/~tack




More information about the gecode-users mailing list