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

Less than comparison X < Y.

Compares two inputs element-wise, returning true where elements in X are less than corresponding elements in Y.

Examples

Comparison between two numbers

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

assertEquals(lt(5, 5), false);

Comparison between a number and an array

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

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

Comparison between a number and a matrix

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

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

Comparison between an array and a number

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

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

Comparison between a matrix and a number

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

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

Comparison between two arrays

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

assertEquals(lt([5, 6, 3], [2, 6, 0]), [false, false, false]);

Comparison between two matrices

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

assertEquals(lt([[5, 6], [-1, 2]], [[5, 6], [3, 5]]), [[false, false], [true, true]]);

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

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

Less than comparison X < Y.

Compares two inputs element-wise, returning true where elements in X are less than corresponding elements in Y.

Examples

Comparison between two numbers

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

assertEquals(lt(5, 5), false);

Comparison between a number and an array

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

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

Comparison between a number and a matrix

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

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

Comparison between an array and a number

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

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

Comparison between a matrix and a number

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

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

Comparison between two arrays

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

assertEquals(lt([5, 6, 3], [2, 6, 0]), [false, false, false]);

Comparison between two matrices

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

assertEquals(lt([[5, 6], [-1, 2]], [[5, 6], [3, 5]]), [[false, false], [true, true]]);

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

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

Less than comparison X < Y.

Compares two inputs element-wise, returning true where elements in X are less than corresponding elements in Y.

Examples

Comparison between two numbers

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

assertEquals(lt(5, 5), false);

Comparison between a number and an array

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

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

Comparison between a number and a matrix

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

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

Comparison between an array and a number

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

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

Comparison between a matrix and a number

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

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

Comparison between two arrays

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

assertEquals(lt([5, 6, 3], [2, 6, 0]), [false, false, false]);

Comparison between two matrices

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

assertEquals(lt([[5, 6], [-1, 2]], [[5, 6], [3, 5]]), [[false, false], [true, true]]);

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

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

Less than comparison X < Y.

Compares two inputs element-wise, returning true where elements in X are less than corresponding elements in Y.

Examples

Comparison between two numbers

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

assertEquals(lt(5, 5), false);

Comparison between a number and an array

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

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

Comparison between a number and a matrix

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

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

Comparison between an array and a number

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

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

Comparison between a matrix and a number

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

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

Comparison between two arrays

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

assertEquals(lt([5, 6, 3], [2, 6, 0]), [false, false, false]);

Comparison between two matrices

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

assertEquals(lt([[5, 6], [-1, 2]], [[5, 6], [3, 5]]), [[false, false], [true, true]]);

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

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

Less than comparison X < Y.

Compares two inputs element-wise, returning true where elements in X are less than corresponding elements in Y.

Examples

Comparison between two numbers

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

assertEquals(lt(5, 5), false);

Comparison between a number and an array

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

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

Comparison between a number and a matrix

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

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

Comparison between an array and a number

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

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

Comparison between a matrix and a number

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

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

Comparison between two arrays

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

assertEquals(lt([5, 6, 3], [2, 6, 0]), [false, false, false]);

Comparison between two matrices

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

assertEquals(lt([[5, 6], [-1, 2]], [[5, 6], [3, 5]]), [[false, false], [true, true]]);

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

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

Less than comparison X < Y.

Compares two inputs element-wise, returning true where elements in X are less than corresponding elements in Y.

Examples

Comparison between two numbers

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

assertEquals(lt(5, 5), false);

Comparison between a number and an array

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

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

Comparison between a number and a matrix

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

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

Comparison between an array and a number

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

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

Comparison between a matrix and a number

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

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

Comparison between two arrays

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

assertEquals(lt([5, 6, 3], [2, 6, 0]), [false, false, false]);

Comparison between two matrices

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

assertEquals(lt([[5, 6], [-1, 2]], [[5, 6], [3, 5]]), [[false, false], [true, true]]);

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

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

Less than comparison X < Y.

Compares two inputs element-wise, returning true where elements in X are less than corresponding elements in Y.

Examples

Comparison between two numbers

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

assertEquals(lt(5, 5), false);

Comparison between a number and an array

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

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

Comparison between a number and a matrix

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

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

Comparison between an array and a number

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

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

Comparison between a matrix and a number

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

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

Comparison between two arrays

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

assertEquals(lt([5, 6, 3], [2, 6, 0]), [false, false, false]);

Comparison between two matrices

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

assertEquals(lt([[5, 6], [-1, 2]], [[5, 6], [3, 5]]), [[false, false], [true, true]]);

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 lt from "elemop/lt.ts";