#91 Permit larger JS integers

This commit is contained in:
Michael Mclaughlin 2016-03-03 23:51:44 +00:00
parent 8ecbc2faf1
commit b4f21813df
1 changed files with 3 additions and 1 deletions

View File

@ -260,7 +260,9 @@
// Disallow numbers with over 15 significant digits if number type.
// 'new BigNumber() number type has more than 15 significant digits: {n}'
if ( num && ERRORS && len > 15 ) raise( id, tooManyDigits, x.s * n );
if ( num && ERRORS && len > 15 && ( n > MAX_SAFE_INTEGER || n !== mathfloor(n) ) ) {
raise( id, tooManyDigits, x.s * n );
}
e = e - i - 1;