DLiteScript

math.round

Rounds a number to the nearest integer.

Examples

1
2
3
printf("%g\n", math.round(4.5))  // 5
printf("%g\n", math.round(4.4))  // 4
printf("%g\n", math.round(-4.5)) // -5