updating oE round


include math.e 
namespace math 
public function round(object a, object precision = 1) 

returns the argument's elements rounded to some precision.

  1. value : an object, each atom of which will be acted upon, no matter how deeply nested.
  2. precision : an object, the rounding precision(s). If not passed, this defaults to 1.

An object, the same shape as value. When value is an atom, the result is that atom rounded to the nearest integer multiple of 1/precision.


This function may be applied to an atom or to all elements of a sequence.

Example 1:
round(5.2) -- 5 
round({4.12, 4.67, -5.8, -5.21}, 10) -- {4.1, 4.7, -5.8, -5.2} 
round(12.2512, 100) -- 12.25 
See Also:

floor, ceil

Not Categorized, Please Help


Quick Links

User menu

Not signed in.

Misc Menu