![]() |
|
Navigation |
Synopsis Round a number to the nearest multiple of a given number (default 1).
Function
Usage
import util::Math;
Examples
rascal>import util::Math; ok rascal>round(3.4); int: 3 rascal>round(3.5); int: 4 rascal>round(3.6); int: 4 rascal>round(-3.4); int: -3 rascal>round(-3.5); int: -4 rascal>round(-3.6); int: -4 rascal>round(13, 5); int: 15 rascal>round(1.5,0.2); real: 1.6 rascal>round(3r2,1r4); rat: 7r4 ![]() |