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

(function)


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

Syntax

(- expr ... )
expr - integer or floating point number/expression
returns - the result of the subtraction

Description

The '-' function subtracts one or more numbers from the first number given and returns the result. If there is only one number as an argument, it is negated.

Examples

(- 1)                                 ; returns -1
(- 1 2)                               ; returns -1
(- 1 2 3)                             ; returns -4
(- 1 2 3 4)                           ; returns -8
(print (+ 1 2 (* 3.5 (/ 3.9 1.45))))  ; returns and prints 12.4138

See the  -  function in the XLISP 2.0 manual.

  Back to Top


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