We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The following model that uses new defined ceil, floor and round constraints gives a wrong answer with gecode.
var -1.75..1.75: p; var -2..2: f; var -2..2: c; var -2..2: r;
constraint f = floor(p) /\ c = ceil(p) /\ r = round(p) / f = -2 /\ c = 0 ; solve satisfy; output ["p = (p)\nf = (f)\nc = (c)\nr = (r)"]
The gecode answer is
p = -1.0 f = -2 c = 0 r = -1
The difference between ceil and floor values should not be greater than one but it is two here.
The text was updated successfully, but these errors were encountered:
I think, the definitions in redefinitions-2.7.1.mzn are incorrect for float_ceil and float_floor. They should be
predicate float_ceil(var float: x, var int: y) = y - 1 < x /\ x <= y;
predicate float_floor(var float: x, var int: y) = y <= x /\ x < y + 1;
Sorry, something went wrong.
a6b5c4b
No branches or pull requests
The following model that uses new defined ceil, floor and round constraints gives a wrong answer with gecode.
var -1.75..1.75: p;
var -2..2: f;
var -2..2: c;
var -2..2: r;
constraint
f = floor(p) /\ c = ceil(p) /\ r = round(p)
/
f = -2 /\ c = 0
;
solve satisfy;
output ["p = (p)\nf = (f)\nc = (c)\nr = (r)"]
The gecode answer is
p = -1.0
f = -2
c = 0
r = -1
The difference between ceil and floor values should not be greater than one but it is two here.
The text was updated successfully, but these errors were encountered: