predictype / bigints / bigintComparison
bigintComparison(
source
,oper
,target
):boolean
Defined in: predicates/bigints/bigintComparison.ts:31
Compares two bigint values using the specified operation.
bigint
The source bigint value.
The comparison operation to perform (e.g. ‘equals’, ‘greater_than’).
bigint
The target bigint value to compare against the source.
boolean
True if the comparison is valid according to the operator, otherwise false.
If the operation is not recognized.
const a = BigInt(10);
const b = BigInt(5);
const c = BigInt(20);
bigintComparison(a, 'equals', a); // true
bigintComparison(a, 'greater_than', b); // true
bigintComparison(a, 'less_than', c); // true
Supported Operators: