ceil<T extends num> static method
Rounds n
to the closest largest integer. The returned value is of the
same type as n
.
Implementation
static T ceil<T extends num>(num n) {
if (T == double || T == num) {
return n.ceilToDouble() as T;
}
else if (T == int) {
return n.ceil() as T;
}
else {
throw "can't ceil to type [${T}]";
}
}