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

Less than or equal comparison X <= Y.

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

Examples

Comparison between two numbers

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

assertEquals(le(5, 5), true);

Comparison between a number and an array

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

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

Comparison between a number and a matrix

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

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

Comparison between an array and a number

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

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

Comparison between a matrix and a number

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

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

Comparison between two arrays

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

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

Comparison between two matrices

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

assertEquals(le([[5, 6], [-1, 2]], [[5, 6], [3, 5]]), [[true, true], [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

le(
x: number,
y: array,
): array<boolean>

Less than or equal comparison X <= Y.

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

Examples

Comparison between two numbers

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

assertEquals(le(5, 5), true);

Comparison between a number and an array

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

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

Comparison between a number and a matrix

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

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

Comparison between an array and a number

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

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

Comparison between a matrix and a number

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

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

Comparison between two arrays

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

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

Comparison between two matrices

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

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

Parameters

x: number

First operand for comparison

Second operand for comparison

Return Type

array<boolean>

The result of the comparison

Throws

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

le(
x: array,
y: number,
): array<boolean>

Less than or equal comparison X <= Y.

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

Examples

Comparison between two numbers

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

assertEquals(le(5, 5), true);

Comparison between a number and an array

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

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

Comparison between a number and a matrix

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

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

Comparison between an array and a number

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

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

Comparison between a matrix and a number

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

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

Comparison between two arrays

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

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

Comparison between two matrices

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

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

Parameters

First operand for comparison

y: number

Second operand for comparison

Return Type

array<boolean>

The result of the comparison

Throws

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

le(
x: array,
y: array,
): array<boolean>

Less than or equal comparison X <= Y.

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

Examples

Comparison between two numbers

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

assertEquals(le(5, 5), true);

Comparison between a number and an array

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

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

Comparison between a number and a matrix

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

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

Comparison between an array and a number

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

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

Comparison between a matrix and a number

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

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

Comparison between two arrays

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

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

Comparison between two matrices

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

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

Parameters

First operand for comparison

Second operand for comparison

Return Type

array<boolean>

The result of the comparison

Throws

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

le(
x: number,
y: matrix,
): matrix<boolean>

Less than or equal comparison X <= Y.

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

Examples

Comparison between two numbers

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

assertEquals(le(5, 5), true);

Comparison between a number and an array

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

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

Comparison between a number and a matrix

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

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

Comparison between an array and a number

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

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

Comparison between a matrix and a number

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

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

Comparison between two arrays

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

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

Comparison between two matrices

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

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

Parameters

x: number

First operand for comparison

Second operand for comparison

Return Type

matrix<boolean>

The result of the comparison

Throws

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

le(
x: matrix,
y: number,
): matrix<boolean>

Less than or equal comparison X <= Y.

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

Examples

Comparison between two numbers

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

assertEquals(le(5, 5), true);

Comparison between a number and an array

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

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

Comparison between a number and a matrix

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

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

Comparison between an array and a number

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

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

Comparison between a matrix and a number

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

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

Comparison between two arrays

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

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

Comparison between two matrices

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

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

Parameters

First operand for comparison

y: number

Second operand for comparison

Return Type

matrix<boolean>

The result of the comparison

Throws

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

le(
x: matrix,
y: matrix,
): matrix<boolean>

Less than or equal comparison X <= Y.

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

Examples

Comparison between two numbers

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

assertEquals(le(5, 5), true);

Comparison between a number and an array

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

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

Comparison between a number and a matrix

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

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

Comparison between an array and a number

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

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

Comparison between a matrix and a number

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

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

Comparison between two arrays

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

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

Comparison between two matrices

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

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

Parameters

First operand for comparison

Second operand for comparison

Return Type

matrix<boolean>

The result of the comparison

Throws

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

Usage

import le from "elemop/le.ts";