an open-source digital signal processing and sound synthesis language
about · links · contact
round - round the argument to the nearest integer


Synopsis

val = round(someval)


Description

round returns (as a double) the nearest integer ("rounded off") value of the argument someval. I.e. 3.789 becomes 4.0; 987.123 become 987.0. This differs from the trunc scorefile command in that it will return the closest int, where trunc simply ignores the values after the decimal point.


Arguments

someval
Any number, floating point or integer (although an int would be silly...)


Examples

   roundedval = round(arbitrary_val)

See Also

abs, log, pow, max, min, mod, trunc, wrap