|
|
|
@ -1,7 +1,6 @@
|
|
|
|
|
if (typeof T === 'undefined') require('../setup');
|
|
|
|
|
|
|
|
|
|
(function () {
|
|
|
|
|
T('integer pow');
|
|
|
|
|
T('integer pow', function () {
|
|
|
|
|
|
|
|
|
|
// Highest finite exponent here is 100
|
|
|
|
|
function t(expected, n, exp) {
|
|
|
|
@ -133,7 +132,6 @@ if (typeof T === 'undefined') require('../setup');
|
|
|
|
|
t('-1.331', '-1.1', 3);
|
|
|
|
|
t('5.125696', '-2.264', 2);
|
|
|
|
|
t('6.7266e-7', '6.7266E-7', 1);
|
|
|
|
|
t('1', '-1', 8);
|
|
|
|
|
t('4142779.6499215776', '21.06', 5);
|
|
|
|
|
t('731.1616', '-5.2', 4);
|
|
|
|
|
t('1', '61818', 0);
|
|
|
|
@ -157,7 +155,6 @@ if (typeof T === 'undefined') require('../setup');
|
|
|
|
|
t('4.122181458338334221291398681640625e+27', '40042.5', 6);
|
|
|
|
|
t('5.94467302491009e+21', '1290.0', 7);
|
|
|
|
|
t('5.6599836943004175019970957e+25', '141437', 5);
|
|
|
|
|
t('9', '3', 2);
|
|
|
|
|
t('69.75757441', '1.7', 8);
|
|
|
|
|
t('1e-42', '0.0000010', 7);
|
|
|
|
|
|
|
|
|
@ -184,8 +181,6 @@ if (typeof T === 'undefined') require('../setup');
|
|
|
|
|
t('287803125756.085809269657829376', '18.76', 9);
|
|
|
|
|
t('4.1069049025e-34', '-2.02655E-17', 2);
|
|
|
|
|
t('-8', '-2', 3);
|
|
|
|
|
t('-5.0787635527751e-52', '-5.51E-11', 5);
|
|
|
|
|
t('-8', '-2', 3);
|
|
|
|
|
t('1704883919.2576', '203.2', 4);
|
|
|
|
|
t('22106814.0740608', '11.2', 7);
|
|
|
|
|
t('3.7481851264119295287828498195966142655968201e+23', '227.71', 10);
|
|
|
|
@ -204,7 +199,6 @@ if (typeof T === 'undefined') require('../setup');
|
|
|
|
|
t('2206809.987903620081317314341735861401', '4.309', 10);
|
|
|
|
|
t('6.1917364224e-80', '-1.2E-8', 10);
|
|
|
|
|
t('64', '-2', 6);
|
|
|
|
|
t('-1', '-1', 7);
|
|
|
|
|
t('-39.8778220049', '-2.09', 5);
|
|
|
|
|
t('892496818.033068251283537321', '-31.029', 6);
|
|
|
|
|
t('1.1289646949223432899980166202016362758071452681629968849e+25', '320.087', 10);
|
|
|
|
@ -316,7 +310,6 @@ if (typeof T === 'undefined') require('../setup');
|
|
|
|
|
t('6.192736416792149755132475219493405669399778858602560762871794455317449717448580836229845787580888290473782381059983387805505374173265513677435445890655671110840202944429668728225878544903602239e-270', '0.000319', 77);
|
|
|
|
|
t('2.321827472731847506187210910989207010589651530892302311791322352855446782760907718473019283821056753242967949096791603718944064726033664384082861996009850744961116407128920163494805886357836270766853975184523023642990429569615539676822828070446559161161124635674389704743948383107212919966543969471039720464085404567773913503635201792672811032312063265454094042341369554833714443413857449688164664657173315113983032808001e+220', '159.83', 100);
|
|
|
|
|
t('4.953736650985698001275587761883016173298229503362193331584010106486052779761329981195411366329068322677550960044762649449732919438910119549694010717647780952298320287365138145210431380601324547389442337520392258009e+27', '-2.797', 62);
|
|
|
|
|
t('-338678221586896.02233451034424755534030583977124338116841050703894756829829935320421996887', '-2.47', 37);
|
|
|
|
|
t('-3.181403788572786716059998378326698266679069780899509454959934125355133265193e-226', '-0.0000057', 43);
|
|
|
|
|
t('2.2481244795444847556680083178853571141700204725943661497539185751725919215990484669445118877448657555202573745174750533635052209260608084995835891707958259234271442982681066779696130155696868114346639852814575962457281749995256623713554214237458259176913852401064878760784275382146658972801541462348779288776844691139086889351786721e+179', '229.03', 76);
|
|
|
|
|
t('1.09544203269304121665791452848994634135137143229447033238750572549632571476402641497730897157401184093614916314911584167715115647604065370616785146866296916632437569033863034458711783186506727022529378159297811462454675308057682780534190256280910865229376785975491743196806996272790525705427972427376758443312371576466422700240638756574402393677191376501159420836822933903938571935476091044876631814554274289087939783553959776485376e+31', '-2.0436', 100);
|
|
|
|
@ -383,7 +376,6 @@ if (typeof T === 'undefined') require('../setup');
|
|
|
|
|
t('-4.429293345196932276984549040219058245905488651609667018402382745119170674779904528756935495114384894434070998056621967747005022674509457845620395626349316891933712941619646377506486625368600115937614507993729672492431012578899815005421568e+37', '-32.051870380', 25);
|
|
|
|
|
t('1.299270565684257922619246441017034698039805547412943905460754496572097300952165266370194652051376805296279609746312644347199238836765289306640625e+56', '-18.85', 44);
|
|
|
|
|
t('1.566108714385843340192620380546546555641735293434509574033302065853656477829384746549085411912657151882140111651595251043453318950397645765893613409097202898027341727466585518405768283017471302953847629952837298920882176e+24', '41.0192888808596', 15);
|
|
|
|
|
t('2.61958676888190130160363553014940478261307337527924200329289138176e+65', '-1866', 20);
|
|
|
|
|
t('3.23590932372253866812859949454563891250217856922745576253641197253435665205998361592799809e+89', '2474977', 14);
|
|
|
|
|
t('-9.7368504802272205153595678239454304952368475046930119079817985916928e+67', '-12', 63);
|
|
|
|
|
t('3.44552147465294110719732986332367243247925798357929806000836849e+62', '-7', 74);
|
|
|
|
@ -562,9 +554,7 @@ if (typeof T === 'undefined') require('../setup');
|
|
|
|
|
tx(function () {new Decimal('12.345').pow(new Date)}, ".pow(new Date)");
|
|
|
|
|
tx(function () {new Decimal('12.345').pow(new RegExp)}, ".pow(new RegExp)");
|
|
|
|
|
tx(function () {new Decimal('12.345').pow(function (){})}, ".pow(function (){})");
|
|
|
|
|
|
|
|
|
|
T.stop();
|
|
|
|
|
})();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
Notes:
|
|
|
|
|