Goto main content

rint

Round to nearest integer.

RINT

NAME

rint - Rounds to nearest integer.

SYNOPSIS

rint(variable);

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}].

SEE ALSO

{{ include("includes/maths.sn") }}

AUTHOR

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

MODIFICATIONS

1.0 2014-09-09 21:24:14 laplante@sednove.com

Edit

© 2024 extenso Inc. All rights reserved.