ceil static method

num ceil(
  1. num a
)

Returns the smallest (closest to negative infinity) value that is greater than or equal to the argument a and is equal to a mathematical integer.

Implementation

static num ceil(num a) {
  if (a is int) return a;

  if (a is double) {
    if (a.isNaN || a.isInfinite) return a;
  }

  var n = a.toInt();
  if (n == a) return n;
  return n + 1;
}