Structural Informatics Group (SIG) logo
Home | Projects | Demos | Downloads | Publications | Local Info | About Us | New site
Go to the first, previous, next, last section, table of contents.

truncate

truncate

type: function (subr) 
location: built-in
source file: xlmath.c
Common LISP compatible: similar
supported on: all machines

SYNTAX

(truncate <expr> )
        <expr>          -       integer or floating point number/expression

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 COMPATIBILITY: Common LISP allows an optional division parameter, which XLISP does not support.


Go to the first, previous, next, last section, table of contents.