CAPL Script

Round

Syntax

long _round(double x);

int64 _round64(double x);

Function

Rounds x to the nearest integral number. The rounding method used is symmetric arithmetic rounding.

Parameters

x Number to be rounded

Return Values

Nearest integral number. For very large numbers, you should use _round64, which returns a 64 bit integer.

long result;result = _round(2.4); // result == 2result = _round(2.5); // result == 3result = _round(-3.5); // result == -4