[ fix ] issue 2616

This commit is contained in:
stefan-hoeck 2022-09-12 09:33:07 +02:00 committed by Mathew Polzin
parent 02dfd6ff6c
commit 188de8b4cc

View File

@ -89,25 +89,25 @@ const _truncBigInt8 = x => {
// Euclidian Division
const _div = (a,b) => {
let q = Math.trunc(a / b)
let r = a % b
const q = Math.trunc(a / b)
const r = a % b
return r < 0 ? (b > 0 ? q - 1 : q + 1) : q
}
const _divBigInt = (a,b) => {
let q = a / b
let r = a % b
const q = a / b
const r = a % b
return r < 0n ? (b > 0n ? q - 1n : q + 1n) : q
}
// Euclidian Modulo
const _mod = (a,b) => {
r = a % b
const r = a % b
return r < 0 ? (b > 0 ? r + b : r - b) : r
}
const _modBigInt = (a,b) => {
r = a % b
const r = a % b
return r < 0n ? (b > 0n ? r + b : r - b) : r
}