indutny / bn.js

BigNum in pure javascript
MIT License
1.19k stars 150 forks source link

About signed zero #215

Closed usd-yamazaki closed 5 years ago

usd-yamazaki commented 5 years ago

Is this correct?

var zero = new BN(0);
zero.toString();
> '0'
zero.subn(1).addn(1).toString();
> '-0'

I expect the following behavior.

var zero = new BN(0);
zero.toString();
> '0'
zero.subn(1).addn(1).toString();
> '0'
fanatid commented 5 years ago

fixed in #216