Skip to content

Commit

Permalink
fix degree function
Browse files Browse the repository at this point in the history
  • Loading branch information
martyall authored and sigma-andex committed Sep 16, 2023
1 parent 00a9347 commit a085ebd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/JS/BigInt.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ export const biDiv = (x) => (y) => {
}

export const biDegree = (x) => {
const xx = x < 0n ? -x : x;
return BigInt.asIntN(32, xx > 2147483647n ? 2147483647n : xx);
return x < 0n ? -x : x;

}

export const biZero = 0n;
Expand Down Expand Up @@ -121,4 +121,4 @@ export const toString = (x) => x.toString();
export const asIntN = (bits) => (n) => BigInt.asIntN(bits, n);
export const asUintN = (bits) => (n) => BigInt.asUintN(bits, n);

export const toStringAs = (radix) => (i) => i.toString(radix);
export const toStringAs = (radix) => (i) => i.toString(radix);

0 comments on commit a085ebd

Please sign in to comment.