an open-source digital signal processing and sound synthesis language
about · links · contact
trunc - truncate value of argument


Synopsis

val = trunc(someval)


Description

trunc returns the truncated (integer part) value of someval. Like all Minc functions, however, it returns it as a double (floating-point) value. For example

    val = trunc(14.154978)
will set val to 14.0. This differs from the round scorefile command in that round 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

   truncval = trunc(arbitrary_val)

See Also

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