EpiNow2 Stan Functions
Home
Functions
functions
helpers.stan
Go to the documentation of this file.
1
int
to_next_int_index
(real x) {
2
if
(x<0) {
3
reject(
"to_next_int_index: x must be non-negative"
);
4
}
5
real x_rounded = round(x);
6
int
i = 1;
7
while
(x_rounded > 1) {
8
x_rounded -= 1;
9
i += 1;
10
}
11
return
(i);
12
}
to_next_int_index
int to_next_int_index(real x)
Definition
helpers.stan:1
Generated by
1.12.0