round function

int round(
  1. num x
)

Implementation

int round(num x) {
  return (x + ((x > 0) ? 0.5 : -0.5)).toInt() << 0;
}