Hi,
I have the following formula:
real custom_function(int n, int m) {
int turn;
for (i in 1:n) {
turn = ceil(i / m) % m;
if (turn) {
// do something
} else {
// do something else
}
}
}
This yields the following error:
Ill-typed arguments supplied to infix operator %. Available signatures:
(int, int) => int
Instead supplied arguments of incompatible type: real, int.
In the docs I see that the input parameter of ceil
should be a real, but the code below also gives the same error:
turn = ceil(1.0 * i / m) % m;
Any advice? Thanks