OpenMusic Reference
om-round

om-round
(arithmetic module) -- Rounds a number or numbers
Syntax
om-round self &optional decimals &optional divisor
Inputs
| name | data type(s) | comments |
|---|---|---|
| self | a number or tree | |
| decimals | a non-negative integer | optional; defaults to 0 |
| divisor | a number | optional; defaults to 1 |
Output
| output | data type(s) | comments |
|---|---|---|
| first | a number; a tree | returns the number or numbers rounded to decimal decimal places |
Description
Rounds a number or tree to the number of decimal places specified at decimal . If decimal is omitted, self is rounded to the nearest integer. If self is a tree, then a tree of identical dimensions is returned, containing all the elements of the tree, rounded.
The second optional input, divisor is used to specify a number by which to divide self (or all elements of self ) before rounding.
| Prev | Home | Next |
|---|---|---|
| om-random | Up | om-scale |