| 1 |
/*** |
| 2 |
!Test |
| 3 |
solvers: [gecode] |
| 4 |
expected: !Result |
| 5 |
status: SATISFIED |
| 6 |
***/ |
| 7 |
|
| 8 |
% Test for pow with par arguments (builtin) and negative exponent |
| 9 |
|
| 10 |
test check_pow(int: x, int: y, int: z) = |
| 11 |
assert(pow(x, y) = z, "Expected pow(\(x), \(y)) = \(z) but got \(pow(x, y))."); |
| 12 |
|
| 13 |
constraint check_pow(-1, -4, 1); |
| 14 |
constraint check_pow(-1, -3, -1); |
| 15 |
constraint check_pow(-1, -2, 1); |
| 16 |
constraint check_pow(-1, -1, -1); |
| 17 |
constraint check_pow(1, -1, 1); |
| 18 |
constraint check_pow(1, -2, 1); |
| 19 |
constraint check_pow(2, -1, 0); % 1 div pow(2, 1) = 0 |
| 20 |
constraint check_pow(2, -2, 0); |
| 21 |
constraint check_pow(-2, -1, 0); |
| 22 |
constraint check_pow(-2, -2, 0); |