MikeMcl / bignumber.js

A JavaScript library for arbitrary-precision decimal and non-decimal arithmetic
http://mikemcl.github.io/bignumber.js
MIT License
6.63k stars 743 forks source link

Strangeness in "minimum" method #344

Closed iKBAHT closed 1 year ago

iKBAHT commented 1 year ago

Actual: BigNumber.minimum(0, -0) is 0

Expected BigNumber.minimum(0, -0) is -0

Interesting that BigNumber.minimum(-0, 0) works just expected (-0)

Online exampe

MikeMcl commented 1 year ago

Good find. I should have had a test case checking that. No doubt maximum has the same issue. I'll apply a fix presently. Thank you for the report.

MikeMcl commented 1 year ago

Fixed in v9.1.2.