Skip to content

Commit

Permalink
fix for
Browse files Browse the repository at this point in the history
var a = thx.Decimal.fromFloat(384) - thx.Decimal.fromFloat(385.937928);
  • Loading branch information
tecteun committed Feb 7, 2018
1 parent b858b0d commit 7da86c3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/thx/bigint/Bigs.hx
Expand Up @@ -206,8 +206,9 @@ class Bigs {
carry = Math.floor(difference / BASE);
// Chrome resolves -1 % 1 to -0 and -0 < 0 == true, Std.int fixes this with -0 | 0 = 0
remainder = Std.int(difference % BASE);
r[i] = difference < 0 ? (remainder < 0 ? remainder + BASE : remainder) : difference;
r[i] = difference < -BASE ? (remainder < 0 ? remainder + BASE : remainder) : difference;
}

var n = arrayToSmall(r);
if(null != n) {
if(sign) n = -n;
Expand Down

0 comments on commit 7da86c3

Please sign in to comment.