mirror of
https://github.com/MikeMcl/decimal.js.git
synced 2026-03-02 03:49:24 +00:00
Bugfix: #58 pow sometimes throws when result is Infinity
This commit is contained in:
@@ -109,6 +109,11 @@ T('pow', function () {
|
||||
t('8.97', '-1', '0.111482720178', 12, 3);
|
||||
t('61766796871807246.3278075', '-1', '0.00000000000000001618993', 7, 0);
|
||||
|
||||
t('-1', '101', '-1', 100, 1);
|
||||
t('-1', '9999999999999999999999999999999999999999999999999999999999999999999999999', '-1', 100, 1);
|
||||
t('-1', '1e307', '1', 100, 1);
|
||||
t('-1', '1e309', '1', 100, 1);
|
||||
|
||||
Decimal.toExpNeg = Decimal.toExpPos = 0;
|
||||
|
||||
t('9.9999999999999', '2220.75', '5.623413251778e+2220', 13, 1);
|
||||
@@ -126,4 +131,9 @@ T('pow', function () {
|
||||
t('908948247.896330216349750387912923575076135766138', '11.38907521122213262858256836', '1.0702278292293091784680297675223031e+102', 35, 3);
|
||||
t('4.485925762349120387154391E+47', '1677945.16766265206929939', '8.53959030215133943e+79957194', 18, 5);
|
||||
t('2.8448989811706207675566E+89', '2.368592228588521845032068137267440272102614', '7.58940197453762187722508511706932e+211', 33, 5);
|
||||
|
||||
t('0.9999999999999999', '-1e+30', '1.530863912e+43429448190325', 10, 1);
|
||||
t('0.9999999999999999999999999999999999999999999999999', '-1e+32', '1.00000000000000001000000000000000005e+0', 36, 1);
|
||||
t('0.9999999999999999', '-1e+50', 'Infinity', 40, 1);
|
||||
t('0.9999999999999999999999999999999899999999999999994403269002375809806554775739676251993670310626872684', '-1.49181945463118148622657269735650603014891811120124843379694396257337810020127409048127397077199569e+271', 'Infinity', 100, 1);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user