XLISP −

Nyquist / XLISP 2.0 - Contents | Tutorials | Examples | Reference

# −

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

## Syntax

(- expr1 ...)
  exprN - 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)         => -1
    (- 1 2)       => -1
    (- 1 2 3)     => -4
    (- 1 2 3 4)   => -8

    > (print (- 1 2 (* 3.5 (/ 3.9 1.45))))
    -10.4138
    -10.4138

See * , / , print. XLISP first prints the value on the screen, the second number is the return value.

See also:

- Contents → Arithmetic Functions

Back to Top

Nyquist / XLISP 2.0 - Contents | Tutorials | Examples | Reference