XLISP > XLISP 2.0  -  Contents  -  Reference  -  Previous | Next

truncate


Type:   -   function (subr)
Source:   -   xlmath.c

Syntax

(truncate expr)
expr - integer or floating point number or expression
returns - the result of truncating expr

Description

The 'truncate' function takes the 'expr' and truncates it to an integer value and returns this result.

Examples

(truncate 123.456)   ; returns 123
(truncate -1.49)     ; returns -1
(truncate -1.59)     ; returns -1
(truncate 123)       ; returns 123
(truncate 123.999)   ; returns 123

Common Lisp: Common LISP allows an optional division parameter, which XLISP does not support.

See the truncate function in the XLISP 2.0 manual.

  Back to Top


XLISP > XLISP 2.0  -  Contents  -  Reference  -  Previous | Next