diff --git a/compiler/jsgen.nim b/compiler/jsgen.nim index 4fde4e300ce3b..1b34a6564197f 100644 --- a/compiler/jsgen.nim +++ b/compiler/jsgen.nim @@ -606,12 +606,12 @@ proc arithAux(p: PProc, n: PNode, r: var TCompRes, op: TMagic) = if n[1].typ.size <= 4: applyFormat("($1 << $2)", "($1 << $2)") else: - applyFormat("($1 * Math.pow(2,$2))", "($1 * Math.pow(2,$2))") + applyFormat("mulInt($1, Math.pow(2,$2))", "($1 * Math.pow(2,$2))") of mAshrI: if n[1].typ.size <= 4: applyFormat("($1 >> $2)", "($1 >> $2)") else: - applyFormat("Math.floor($1 / Math.pow(2,$2))", "Math.floor($1 / Math.pow(2,$2))") + applyFormat("divInt($1, Math.pow(2,$2))", "Math.trunc($1 / Math.pow(2,$2))") of mBitandI: applyFormat("($1 & $2)", "($1 & $2)") of mBitorI: applyFormat("($1 | $2)", "($1 | $2)") of mBitxorI: applyFormat("($1 ^ $2)", "($1 ^ $2)")