Skip to content

Commit

Permalink
Allow { s: null, e: null, c: null } (NaN)
Browse files Browse the repository at this point in the history
  • Loading branch information
iamdoron committed Feb 18, 2019
1 parent cefa7c8 commit 8c34396
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bignumber.js
Expand Up @@ -196,7 +196,7 @@

// Duplicate.
if (n instanceof BigNumber
|| (n != null && n.s != null && n.e != null && n.c != null)) {
|| (n && typeof n.s !== 'undefined' && typeof n.e !== 'undefined' && typeof n.c !== 'undefined')) {
x.s = n.s;
x.e = n.e;
x.c = (n = n.c) ? n.slice() : n;
Expand Down
1 change: 1 addition & 0 deletions test/methods/BigNumber.js
Expand Up @@ -201,6 +201,7 @@ Test('bigNumber', function () {

t('100002222.2222333322', new BigNumber({ s: 1, e: 8, c: [100002222, 22223333220000] }).toString())
t('7777777777.123123123', new BigNumber({ s: 1, e: 9, c: [7777777777, 12312312300000] }).toString())
t('NaN', new BigNumber({ s: null, e: null, c: null }).toString())

// Base-conversion tests

Expand Down

0 comments on commit 8c34396

Please sign in to comment.