function

rint . math . sncode

VERSIONlatest Round to nearest integer.

RINT

NAME

rint - Rounds to nearest integer.

SYNOPSIS

rint(var);

DESCRIPTION

The rint() functions round their argument to an integer value in floating point format, using the current rounding direction and without raising the inexact exception.

The rint function rounds its argument to an integer value in floating point format, using the current rounding direction and without raising the inexact exception. This means that it will only return the number before the comma.

EXAMPLES

Note: In the followings examples, the _ between the { should be removed to make it work.

res={_{rint(2.5); }}. return res=2.
res={_{rint("2.5"); }}. return res=2.
res={_{rint(-2.5); }}. return res=-2.
res={_{a=[-2, 2, 2.5, { x : -2.5 } ]; rint(a); a;}}. return res=\[-2,2,2,{"x":-2}]\[-2,2,2.5,{"x":-2.5}].

AUTHOR

Written by Pierre Laplante and Caroline Laplante, <laplante@sednove.com>