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.

rem

rem

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

SYNTAX

(rem <expr1> ... )
        <exprN>         -       integer number/expression

DESCRIPTION

The REM function takes the first pair of expressions and determines what is the remainder from dividing the first by the second expression. If there are no other arguments, this value is returned. If there are additional arguments, the remainder of the first pair is applied to the next and then the next and so on. In other words, (REM A B C D) is equivalent to (REM (REM (REM A B) C) D).

EXAMPLES

(rem 1)                                 ; returns 1
(rem 1 2)                               ; returns 1
(rem 13 8)                              ; returns 5
(rem 13 8 3)                            ; returns 2
(rem 13.5 8)                            ; error: bad flt.pt. operation

COMMON LISP COMPATIBILITY: Common LISP only allows two arguments. XLISP supports an arbitrary number of arguments. Also, Common LISP allows for floating point expressions where XLISP does not support this.


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