function ne
ne(
x: number,
y: number,
): boolean

Not equal comparison X ~= Y.

Compares two inputs element-wise, returning true where elements in X are not equal to corresponding elements in Y.

Examples

Compare two numbers

import { assertEquals } from "jsr:@std/assert";

assertEquals(ne(5, 5), false);

Compare a number with an array

import { assertEquals } from "jsr:@std/assert";

assertEquals(ne(5, [5, 6, 3]), [false, true, true]);

Compare a number with a matrix

import { assertEquals } from "jsr:@std/assert";

assertEquals(ne(5, [[5, 6], [3, 5]]), [[false, true], [true, false]]);

Compare an array with a number

import { assertEquals } from "jsr:@std/assert";

assertEquals(ne([5, 6, 3], 5), [false, true, true]);

Compare a matrix with a number

import { assertEquals } from "jsr:@std/assert";

assertEquals(ne([[5, 6], [3, 5]], 5), [[false, true], [true, false]]);

Compare two arrays

import { assertEquals } from "jsr:@std/assert";

assertEquals(ne([5, 6, 3], [5, 6, 4]), [false, false, true]);

Compare two matrices

import { assertEquals } from "jsr:@std/assert";

assertEquals(ne([[5, 6], [3, 5]], [[5, 7], [3, 5]]), [[false, true], [false, false]]);

Parameters

x: number

First operand for comparison

y: number

Second operand for comparison

Return Type

boolean

The result of the comparison

Throws

If the input dimensions do not agree or if no arguments are provided

ne(
x: number,
y: array,
): boolean[]

Not equal comparison X ~= Y.

Compares two inputs element-wise, returning true where elements in X are not equal to corresponding elements in Y.

Examples

Compare two numbers

import { assertEquals } from "jsr:@std/assert";

assertEquals(ne(5, 5), false);

Compare a number with an array

import { assertEquals } from "jsr:@std/assert";

assertEquals(ne(5, [5, 6, 3]), [false, true, true]);

Compare a number with a matrix

import { assertEquals } from "jsr:@std/assert";

assertEquals(ne(5, [[5, 6], [3, 5]]), [[false, true], [true, false]]);

Compare an array with a number

import { assertEquals } from "jsr:@std/assert";

assertEquals(ne([5, 6, 3], 5), [false, true, true]);

Compare a matrix with a number

import { assertEquals } from "jsr:@std/assert";

assertEquals(ne([[5, 6], [3, 5]], 5), [[false, true], [true, false]]);

Compare two arrays

import { assertEquals } from "jsr:@std/assert";

assertEquals(ne([5, 6, 3], [5, 6, 4]), [false, false, true]);

Compare two matrices

import { assertEquals } from "jsr:@std/assert";

assertEquals(ne([[5, 6], [3, 5]], [[5, 7], [3, 5]]), [[false, true], [false, false]]);

Parameters

x: number

First operand for comparison

Second operand for comparison

Return Type

boolean[]

The result of the comparison

Throws

If the input dimensions do not agree or if no arguments are provided

ne(
x: array,
y: number,
): boolean[]

Not equal comparison X ~= Y.

Compares two inputs element-wise, returning true where elements in X are not equal to corresponding elements in Y.

Examples

Compare two numbers

import { assertEquals } from "jsr:@std/assert";

assertEquals(ne(5, 5), false);

Compare a number with an array

import { assertEquals } from "jsr:@std/assert";

assertEquals(ne(5, [5, 6, 3]), [false, true, true]);

Compare a number with a matrix

import { assertEquals } from "jsr:@std/assert";

assertEquals(ne(5, [[5, 6], [3, 5]]), [[false, true], [true, false]]);

Compare an array with a number

import { assertEquals } from "jsr:@std/assert";

assertEquals(ne([5, 6, 3], 5), [false, true, true]);

Compare a matrix with a number

import { assertEquals } from "jsr:@std/assert";

assertEquals(ne([[5, 6], [3, 5]], 5), [[false, true], [true, false]]);

Compare two arrays

import { assertEquals } from "jsr:@std/assert";

assertEquals(ne([5, 6, 3], [5, 6, 4]), [false, false, true]);

Compare two matrices

import { assertEquals } from "jsr:@std/assert";

assertEquals(ne([[5, 6], [3, 5]], [[5, 7], [3, 5]]), [[false, true], [false, false]]);

Parameters

First operand for comparison

y: number

Second operand for comparison

Return Type

boolean[]

The result of the comparison

Throws

If the input dimensions do not agree or if no arguments are provided

ne(
x: array,
y: array,
): boolean[]

Not equal comparison X ~= Y.

Compares two inputs element-wise, returning true where elements in X are not equal to corresponding elements in Y.

Examples

Compare two numbers

import { assertEquals } from "jsr:@std/assert";

assertEquals(ne(5, 5), false);

Compare a number with an array

import { assertEquals } from "jsr:@std/assert";

assertEquals(ne(5, [5, 6, 3]), [false, true, true]);

Compare a number with a matrix

import { assertEquals } from "jsr:@std/assert";

assertEquals(ne(5, [[5, 6], [3, 5]]), [[false, true], [true, false]]);

Compare an array with a number

import { assertEquals } from "jsr:@std/assert";

assertEquals(ne([5, 6, 3], 5), [false, true, true]);

Compare a matrix with a number

import { assertEquals } from "jsr:@std/assert";

assertEquals(ne([[5, 6], [3, 5]], 5), [[false, true], [true, false]]);

Compare two arrays

import { assertEquals } from "jsr:@std/assert";

assertEquals(ne([5, 6, 3], [5, 6, 4]), [false, false, true]);

Compare two matrices

import { assertEquals } from "jsr:@std/assert";

assertEquals(ne([[5, 6], [3, 5]], [[5, 7], [3, 5]]), [[false, true], [false, false]]);

Parameters

First operand for comparison

Second operand for comparison

Return Type

boolean[]

The result of the comparison

Throws

If the input dimensions do not agree or if no arguments are provided

ne(
x: number,
y: matrix,
): boolean[][]

Not equal comparison X ~= Y.

Compares two inputs element-wise, returning true where elements in X are not equal to corresponding elements in Y.

Examples

Compare two numbers

import { assertEquals } from "jsr:@std/assert";

assertEquals(ne(5, 5), false);

Compare a number with an array

import { assertEquals } from "jsr:@std/assert";

assertEquals(ne(5, [5, 6, 3]), [false, true, true]);

Compare a number with a matrix

import { assertEquals } from "jsr:@std/assert";

assertEquals(ne(5, [[5, 6], [3, 5]]), [[false, true], [true, false]]);

Compare an array with a number

import { assertEquals } from "jsr:@std/assert";

assertEquals(ne([5, 6, 3], 5), [false, true, true]);

Compare a matrix with a number

import { assertEquals } from "jsr:@std/assert";

assertEquals(ne([[5, 6], [3, 5]], 5), [[false, true], [true, false]]);

Compare two arrays

import { assertEquals } from "jsr:@std/assert";

assertEquals(ne([5, 6, 3], [5, 6, 4]), [false, false, true]);

Compare two matrices

import { assertEquals } from "jsr:@std/assert";

assertEquals(ne([[5, 6], [3, 5]], [[5, 7], [3, 5]]), [[false, true], [false, false]]);

Parameters

x: number

First operand for comparison

Second operand for comparison

Return Type

boolean[][]

The result of the comparison

Throws

If the input dimensions do not agree or if no arguments are provided

ne(
x: matrix,
y: number,
): boolean[][]

Not equal comparison X ~= Y.

Compares two inputs element-wise, returning true where elements in X are not equal to corresponding elements in Y.

Examples

Compare two numbers

import { assertEquals } from "jsr:@std/assert";

assertEquals(ne(5, 5), false);

Compare a number with an array

import { assertEquals } from "jsr:@std/assert";

assertEquals(ne(5, [5, 6, 3]), [false, true, true]);

Compare a number with a matrix

import { assertEquals } from "jsr:@std/assert";

assertEquals(ne(5, [[5, 6], [3, 5]]), [[false, true], [true, false]]);

Compare an array with a number

import { assertEquals } from "jsr:@std/assert";

assertEquals(ne([5, 6, 3], 5), [false, true, true]);

Compare a matrix with a number

import { assertEquals } from "jsr:@std/assert";

assertEquals(ne([[5, 6], [3, 5]], 5), [[false, true], [true, false]]);

Compare two arrays

import { assertEquals } from "jsr:@std/assert";

assertEquals(ne([5, 6, 3], [5, 6, 4]), [false, false, true]);

Compare two matrices

import { assertEquals } from "jsr:@std/assert";

assertEquals(ne([[5, 6], [3, 5]], [[5, 7], [3, 5]]), [[false, true], [false, false]]);

Parameters

First operand for comparison

y: number

Second operand for comparison

Return Type

boolean[][]

The result of the comparison

Throws

If the input dimensions do not agree or if no arguments are provided

ne(
x: matrix,
y: matrix,
): boolean[][]

Not equal comparison X ~= Y.

Compares two inputs element-wise, returning true where elements in X are not equal to corresponding elements in Y.

Examples

Compare two numbers

import { assertEquals } from "jsr:@std/assert";

assertEquals(ne(5, 5), false);

Compare a number with an array

import { assertEquals } from "jsr:@std/assert";

assertEquals(ne(5, [5, 6, 3]), [false, true, true]);

Compare a number with a matrix

import { assertEquals } from "jsr:@std/assert";

assertEquals(ne(5, [[5, 6], [3, 5]]), [[false, true], [true, false]]);

Compare an array with a number

import { assertEquals } from "jsr:@std/assert";

assertEquals(ne([5, 6, 3], 5), [false, true, true]);

Compare a matrix with a number

import { assertEquals } from "jsr:@std/assert";

assertEquals(ne([[5, 6], [3, 5]], 5), [[false, true], [true, false]]);

Compare two arrays

import { assertEquals } from "jsr:@std/assert";

assertEquals(ne([5, 6, 3], [5, 6, 4]), [false, false, true]);

Compare two matrices

import { assertEquals } from "jsr:@std/assert";

assertEquals(ne([[5, 6], [3, 5]], [[5, 7], [3, 5]]), [[false, true], [false, false]]);

Parameters

First operand for comparison

Second operand for comparison

Return Type

boolean[][]

The result of the comparison

Throws

If the input dimensions do not agree or if no arguments are provided

Usage

import ne from "elemop/ne.ts";