round

fun round(d: Float): Int

Ends up being a bit faster than the platform rounding implementation. This merely rounds its argument to the nearest int, where x.5 rounds up to x+1. Semantics of this shortcut differ slightly from platform rounding in that half rounds down for negative values. -2.5 rounds to -3, not -2. For purposes here it makes no difference.

Return

nearest int

Parameters

d

real value to round