Atom

math.round()

Rounds to the nearest integer, with halfway cases away from zero.

Signature

math.round(x)

Parameters

One number.

Returns

Integral-valued f64 for finite input.

Behavior

Uses the C math operation.

Errors

Requires a number.

Example

Atom
use math
assert(math.round(-1.5) == -2.0)