Trunc()

From TinyMUX
Revision as of 05:53, 17 January 2006 by Ian (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Description

FUNCTION: trunc(number)

Returns the value of number after truncating off any fractional value. number may be a floating point number, and an integer result is returned.

Related Topics: fdiv(), floor(), mod(), round().

Examples

> say trunc(5)
You say "5"
> say trunc(5.2)
You say "5"
> say trunc(5.8)
You say "5"
> say trunc(-5)
You say "-5"
> say trunc(-5.2)
You say "-5"

(--Soylent 01:00, 3 December 2005 (EST))