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

Greater than comparison X > Y.

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

Examples

Comparison between two numbers

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

assertEquals(gt(5, 5), false);

Comparison between a number and an array

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

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

Comparison between a number and a matrix

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

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

Comparison between an array and a number

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

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

Comparison between a matrix and a number

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

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

Comparison between two arrays

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

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

Comparison between two matrices

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

assertEquals(gt([[5, 6], [3, 5]], [[4, 6], [3, 4]]), [[true, false], [false, 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

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

Greater than comparison X > Y.

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

Examples

Comparison between two numbers

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

assertEquals(gt(5, 5), false);

Comparison between a number and an array

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

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

Comparison between a number and a matrix

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

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

Comparison between an array and a number

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

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

Comparison between a matrix and a number

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

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

Comparison between two arrays

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

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

Comparison between two matrices

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

assertEquals(gt([[5, 6], [3, 5]], [[4, 6], [3, 4]]), [[true, false], [false, 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

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

Greater than comparison X > Y.

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

Examples

Comparison between two numbers

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

assertEquals(gt(5, 5), false);

Comparison between a number and an array

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

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

Comparison between a number and a matrix

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

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

Comparison between an array and a number

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

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

Comparison between a matrix and a number

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

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

Comparison between two arrays

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

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

Comparison between two matrices

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

assertEquals(gt([[5, 6], [3, 5]], [[4, 6], [3, 4]]), [[true, false], [false, 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

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

Greater than comparison X > Y.

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

Examples

Comparison between two numbers

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

assertEquals(gt(5, 5), false);

Comparison between a number and an array

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

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

Comparison between a number and a matrix

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

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

Comparison between an array and a number

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

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

Comparison between a matrix and a number

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

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

Comparison between two arrays

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

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

Comparison between two matrices

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

assertEquals(gt([[5, 6], [3, 5]], [[4, 6], [3, 4]]), [[true, false], [false, 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

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

Greater than comparison X > Y.

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

Examples

Comparison between two numbers

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

assertEquals(gt(5, 5), false);

Comparison between a number and an array

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

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

Comparison between a number and a matrix

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

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

Comparison between an array and a number

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

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

Comparison between a matrix and a number

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

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

Comparison between two arrays

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

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

Comparison between two matrices

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

assertEquals(gt([[5, 6], [3, 5]], [[4, 6], [3, 4]]), [[true, false], [false, 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

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

Greater than comparison X > Y.

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

Examples

Comparison between two numbers

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

assertEquals(gt(5, 5), false);

Comparison between a number and an array

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

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

Comparison between a number and a matrix

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

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

Comparison between an array and a number

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

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

Comparison between a matrix and a number

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

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

Comparison between two arrays

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

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

Comparison between two matrices

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

assertEquals(gt([[5, 6], [3, 5]], [[4, 6], [3, 4]]), [[true, false], [false, 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

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

Greater than comparison X > Y.

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

Examples

Comparison between two numbers

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

assertEquals(gt(5, 5), false);

Comparison between a number and an array

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

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

Comparison between a number and a matrix

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

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

Comparison between an array and a number

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

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

Comparison between a matrix and a number

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

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

Comparison between two arrays

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

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

Comparison between two matrices

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

assertEquals(gt([[5, 6], [3, 5]], [[4, 6], [3, 4]]), [[true, false], [false, 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 gt from "elemop/gt.ts";