fix
This commit is contained in:
parent
1f2249e75a
commit
63b1aa6238
2 changed files with 4 additions and 4 deletions
|
|
@ -2,14 +2,14 @@
|
|||
|
||||
export const compareInts = x => y => {
|
||||
if (typeof(x) !== 'bigint' || typeof(y) !== 'bigint') {
|
||||
throw new Error(`was only meant to compare bigints! got ${x} and ${y}`);
|
||||
throw new Error(`was only meant to compare bigints! got ${x} (${typeof(x)}) and ${y} (${typeof(y)})`);
|
||||
}
|
||||
return (x < y) ? -1 : (x > y) ? 1 : 0;
|
||||
};
|
||||
|
||||
export const compareDoubles = x => y => {
|
||||
if (typeof(x) !== 'number' || typeof(y) !== 'number') {
|
||||
throw new Error(`was only meant to compare numbers! got ${x} and ${y}`);
|
||||
throw new Error(`was only meant to compare numbers! got ${x} (${typeof(x)}) and ${y} (${typeof(y)})`);
|
||||
}
|
||||
return (x < y) ? -1 : (x > y) ? 1 : 0;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue