XLISP /=

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

# /=

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

## Syntax

(/= expr1 expr2 ...)
  exprN - a numeric expression
  returns - T if the results of comparing the expressions are all true, NIL otherwise

## Description

The '/=' [not-equal] function takes an arbitrary number of numeric arguments. It checks to see if all the numeric arguments are different. T is returned if the arguments are numerically not equivalent, NIL is returned otherwise.

## Examples

    (/= 1 1)            => NIL
    (/= 1 2)            => T
    (/= 1 1.0)          => NIL
    (/= 1 2 3)          => T
    (/= 1 2 2)          => NIL
    (/= "a" "b")        => error: bad argument type
    (setq a 1 b 12.4)   => 12.4  ; set up A and B with values
    (/= a b)            => NIL

See setq.

XLISP Bug

    (/= 1 2 3)      => T  ; OK
    (/= 1 2 3 2 1)  => T  ; wrong

This is only a problem for the '/=' function. The bug can be reproduced with Nyquist 3.03 in November 2010.

See also:

- Contents → Arithmetic Functions

Back to Top

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