[Gecode] Testing arithmetic rounding
schulte at imit.kth.se
Tue Aug 23 20:32:06 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...
Guido, if you feel its too messy I could remove it, we do not need it badly.
From: gecode-bounces at ps.uni-sb.de [mailto:gecode-bounces at ps.uni-sb.de] On
Behalf Of Guido Tack
Sent: Tuesday, August 23, 2005 9:43 AM
To: gecode at ps.uni-sb.de
Subject: [Gecode] Testing arithmetic rounding
I've just removed the rounding test from configure.ac and the Makefiles. I
have replaced it with a check in int/view.icc:
#if (-17 / 7) == -2
#define GECODE_INT_RND_TWDS_ZERO 1
#define GECODE_INT_RND_TWDS_ZERO 0
This assumes that the preprocessor rounds the same way as the compiler, and
actually have no idea if it always does. This is however the same test we've
been using in configure.ac so far.
Does anyone know a platform where rounding is not defined towards zero? I'd
just like to test if the preprocessor rounds the same way there.
Programming Systems Lab, Saarland University, Saarbrücken
Gecode mailing list
Gecode at ps.uni-sb.de http://www.ps.uni-sb.de/mailman/listinfo/gecode
More information about the gecode-users