bignumber-vs-bigdecimal.html 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691
  1. <!DOCTYPE html>
  2. <html lang='en'>
  3. <head>
  4. <meta charset='utf-8' />
  5. <meta name="Author" content="M Mclaughlin">
  6. <title>Testing BigNumber</title>
  7. <style>
  8. body {margin: 0; padding: 0; font-family: Calibri, Arial, Sans-Serif;}
  9. div {margin: 1em 0;}
  10. h1, #counter {text-align: center; background-color: rgb(225, 225, 225);
  11. margin-top: 1em; padding: 0.2em; font-size: 1.2em;}
  12. a {color: rgb(0, 153, 255); margin: 0 0.6em;}
  13. .links {position: fixed; bottom: 1em; right: 2em; font-size: 0.8em;}
  14. .form, #time {width: 36em; margin: 0 auto;}
  15. .form {text-align: left; margin-top: 1.4em;}
  16. .random input {margin-left: 1em;}
  17. .small {font-size: 0.9em;}
  18. .methods {margin: 1em auto; width: 28em;}
  19. .iterations input, .left {margin-left: 1.6em;}
  20. .info span {margin-left: 1.6em; font-size: 0.9em;}
  21. .info {margin-top: 1.6em;}
  22. .random input, .iterations input {margin-right: 0.3em;}
  23. .random label, .iterations label, .bigd label {font-size: 0.9em;
  24. margin-left: 0.1em;}
  25. .methods label {width: 5em; margin-left: 0.2em; display: inline-block;}
  26. .methods label.right {width: 2em;}
  27. .red {color: red; font-size: 1.1em; font-weight: bold;}
  28. button {width: 10em; height: 2em;}
  29. #dp, #r, #digits, #reps {margin-left: 0.8em;}
  30. #bigint {font-style: italic; display: none;}
  31. #gwt, #icu4j, #bd, #bigint {margin-left: 1.5em;}
  32. #division {display: none;}
  33. #counter {font-size: 2em; background-color: rgb(235, 235, 235);}
  34. #time {text-align: center;}
  35. #results {margin: 0 1.4em;}
  36. </style>
  37. <script src='../bignumber.js'></script>
  38. <script src='./lib/bigdecimal_GWT/bigdecimal.js'></script>
  39. </head>
  40. <body>
  41. <h1>Testing BigNumber against BigDecimal</h1>
  42. <div class='form'>
  43. <div class='methods'>
  44. <input type='radio' id=0 name=1/><label for=0>plus</label>
  45. <input type='radio' id=3 name=1/><label for=3>dividedBy</label>
  46. <input type='radio' id=6 name=1/><label for=6 class='right'>absoluteValue</label>
  47. <br>
  48. <input type='radio' id=1 name=1/><label for=1>minus</label>
  49. <input type='radio' id=4 name=1/><label for=4>modulo</label>
  50. <input type='radio' id=7 name=1/><label for=7 class='right'>negated</label>
  51. <br>
  52. <input type='radio' id=2 name=1/><label for=2>multipliedBy</label>
  53. <input type='radio' id=5 name=1/><label for=5>comparedTo</label>
  54. <input type='radio' id=8 name=1/><label for=8 class='right'>exponentiatedBy</label>
  55. </div>
  56. <div class='bigd'>
  57. <span>BigDecimal:</span>
  58. <input type='radio' name=2 id='gwt' /><label for='gwt'>GWT</label>
  59. <input type='radio' name=2 id='icu4j' /><label for='icu4j'>ICU4J</label>
  60. <span id='bigint'>BigInteger</span>
  61. <span id='bd'>add</span>
  62. </div>
  63. <div class='random'>
  64. Random number digits:<input type='text' id='digits' size=12 />
  65. <input type='radio' name=3 id='fix' /><label for='fix'>Fixed</label>
  66. <input type='radio' name=3 id='max' /><label for='max'>Max</label>
  67. <input type='checkbox' id='int' /><label for='int'>Integers only</label>
  68. </div>
  69. <div id='division'>
  70. <span>Decimal places:<input type='text' id='dp' size=9 /></span>
  71. <span class='left'>Rounding:<select id='r'>
  72. <option>UP</option>
  73. <option>DOWN</option>
  74. <option>CEIL</option>
  75. <option>FLOOR</option>
  76. <option>HALF_UP</option>
  77. <option>HALF_DOWN</option>
  78. <option>HALF_EVEN</option>
  79. </select></span>
  80. </div>
  81. <div class='iterations'>
  82. Iterations:<input type='text' id='reps' size=11 />
  83. <input type='checkbox' id='show'/><label for='show'>Show all (no timing)</label>
  84. </div>
  85. <div class='info'>
  86. <button id='start'>Start</button>
  87. <span>Click a method to stop</span>
  88. <span>Press space bar to pause/unpause</span>
  89. </div>
  90. </div>
  91. <div id='counter'>0</div>
  92. <div id='time'></div>
  93. <div id='results'></div>
  94. <div class='links'>
  95. <a href='https://github.com/MikeMcl/bignumber.js' target='_blank'>BigNumber</a>
  96. <a href='https://github.com/iriscouch/bigdecimal.js' target='_blank'>GWT</a>
  97. <a href='https://github.com/dtrebbien/BigDecimal.js/tree/' target='_blank'>ICU4J</a>
  98. </div>
  99. <script>
  100. var i, completedReps, targetReps, cycleReps, cycleTime, prevCycleReps, cycleLimit,
  101. maxDigits, isFixed, isIntOnly, decimalPlaces, rounding, calcTimeout,
  102. counterTimeout, script, isGWT, BigDecimal_GWT, BigDecimal_ICU4J,
  103. bdM, bdTotal, bnM, bnTotal,
  104. bdMs = ['add', 'subtract', 'multiply', 'divide', 'remainder', 'compareTo',
  105. 'abs', 'negate', 'pow'],
  106. bnMs = ['plus', 'minus', 'multipliedBy', 'dividedBy', 'modulo', 'comparedTo', 'absoluteValue',
  107. 'negated', 'exponentiatedBy'],
  108. lastRounding = 4,
  109. pause = false,
  110. up = true,
  111. timingVisible = false,
  112. showAll = false,
  113. // Edit defaults here
  114. DEFAULT_REPS = 10000,
  115. DEFAULT_DIGITS = 20,
  116. DEFAULT_DECIMAL_PLACES = 20,
  117. DEFAULT_ROUNDING = 4,
  118. MAX_POWER = 20,
  119. CHANCE_NEGATIVE = 0.5, // 0 (never) to 1 (always)
  120. CHANCE_INTEGER = 0.2, // 0 (never) to 1 (always)
  121. MAX_RANDOM_EXPONENT = 100,
  122. SPACE_BAR = 32,
  123. ICU4J_URL = './lib/bigdecimal_ICU4J/BigDecimal-all-last.js',
  124. //
  125. $ = function (id) {return document.getElementById(id)},
  126. $INPUTS = document.getElementsByTagName('input'),
  127. $BD = $('bd'),
  128. $BIGINT = $('bigint'),
  129. $DIGITS = $('digits'),
  130. $GWT = $('gwt'),
  131. $ICU4J = $('icu4j'),
  132. $FIX = $('fix'),
  133. $MAX = $('max'),
  134. $INT = $('int'),
  135. $DIV = $('division'),
  136. $DP = $('dp'),
  137. $R = $('r'),
  138. $REPS = $('reps'),
  139. $SHOW = $('show'),
  140. $START = $('start'),
  141. $COUNTER = $('counter'),
  142. $TIME = $('time'),
  143. $RESULTS = $('results'),
  144. // Get random number in normal notation.
  145. getRandom = function () {
  146. var z,
  147. i = 0,
  148. // n is the number of digits - 1
  149. n = isFixed ? maxDigits - 1 : Math.random() * (maxDigits || 1) | 0,
  150. r = ( Math.random() * 10 | 0 ) + '';
  151. if (n) {
  152. if (r == '0')
  153. r = isIntOnly ? ( ( Math.random() * 9 | 0 ) + 1 ) + '' : (z = r + '.');
  154. for ( ; i++ < n; r += Math.random() * 10 | 0 ){}
  155. if (!z && !isIntOnly && Math.random() > CHANCE_INTEGER) {
  156. r = r.slice( 0, i = (Math.random() * n | 0) + 1 ) +
  157. '.' + r.slice(i);
  158. }
  159. }
  160. // Avoid division by zero error with division and modulo
  161. if ((bdM == 'divide' || bdM == 'remainder') && parseFloat(r) === 0)
  162. r = ( ( Math.random() * 9 | 0 ) + 1 ) + '';
  163. return Math.random() > CHANCE_NEGATIVE ? r : '-' + r;
  164. },
  165. // Get random number in exponential notation (if isIntOnly is false).
  166. // GWT BigDecimal BigInteger does not accept exponential notation.
  167. //getRandom = function () {
  168. // var i = 0,
  169. // // n is the number of significant digits - 1
  170. // n = isFixed ? maxDigits - 1 : Math.random() * (maxDigits || 1) | 0,
  171. // r = ( ( Math.random() * 9 | 0 ) + 1 ) + '';
  172. //
  173. // for (; i++ < n; r += Math.random() * 10 | 0 ){}
  174. //
  175. // if ( !isIntOnly ) {
  176. //
  177. // // Add exponent.
  178. // r += 'e' + ( Math.random() > 0.5 ? '+' : '-' ) +
  179. // ( Math.random() * MAX_RANDOM_EXPONENT | 0 );
  180. // }
  181. //
  182. // return Math.random() > CHANCE_NEGATIVE ? r : '-' + r
  183. //},
  184. showTimings = function () {
  185. var i, bdS, bnS,
  186. sp = '',
  187. r = bnTotal < bdTotal
  188. ? (bnTotal ? bdTotal / bnTotal : bdTotal)
  189. : (bdTotal ? bnTotal / bdTotal : bnTotal);
  190. bdS = 'BigDecimal: ' + (bdTotal || '<1');
  191. bnS = 'BigNumber: ' + (bnTotal || '<1');
  192. for ( i = bdS.length - bnS.length; i-- > 0; sp += '&nbsp;'){}
  193. bnS = 'BigNumber: ' + sp + (bnTotal || '<1');
  194. $TIME.innerHTML =
  195. 'No mismatches<div>' + bdS + ' ms<br>' + bnS + ' ms</div>' +
  196. ((r = parseFloat(r.toFixed(1))) > 1
  197. ? 'Big' + (bnTotal < bdTotal ? 'Number' : 'Decimal')
  198. + ' was ' + r + ' times faster'
  199. : 'Times approximately equal');
  200. },
  201. clear = function () {
  202. clearTimeout(calcTimeout);
  203. clearTimeout(counterTimeout);
  204. $COUNTER.style.textDecoration = 'none';
  205. $COUNTER.innerHTML = '0';
  206. $TIME.innerHTML = $RESULTS.innerHTML = '';
  207. $START.innerHTML = 'Start';
  208. },
  209. begin = function () {
  210. var i;
  211. clear();
  212. targetReps = +$REPS.value;
  213. if (!(targetReps > 0)) return;
  214. $START.innerHTML = 'Restart';
  215. i = +$DIGITS.value;
  216. $DIGITS.value = maxDigits = i && isFinite(i) ? i : DEFAULT_DIGITS;
  217. for (i = 0; i < 9; i++) {
  218. if ($INPUTS[i].checked) {
  219. bnM = bnMs[$INPUTS[i].id];
  220. bdM = bdMs[$INPUTS[i].id];
  221. break;
  222. }
  223. }
  224. if (bdM == 'divide') {
  225. i = +$DP.value;
  226. $DP.value = decimalPlaces = isFinite(i) ? i : DEFAULT_DECIMAL_PLACES;
  227. rounding = +$R.selectedIndex;
  228. BigNumber.config({ DECIMAL_PLACES: decimalPlaces, ROUNDING_MODE: rounding });
  229. }
  230. isFixed = $FIX.checked;
  231. isIntOnly = $INT.checked;
  232. showAll = $SHOW.checked;
  233. BigDecimal = (isGWT = $GWT.checked)
  234. ? (isIntOnly ? BigInteger : BigDecimal_GWT)
  235. : BigDecimal_ICU4J;
  236. prevCycleReps = cycleLimit = completedReps = bdTotal = bnTotal = 0;
  237. pause = false;
  238. cycleReps = showAll ? 1 : 0.5;
  239. cycleTime = +new Date();
  240. setTimeout(updateCounter, 0);
  241. },
  242. updateCounter = function () {
  243. if (pause) {
  244. if (!timingVisible && !showAll) {
  245. showTimings();
  246. timingVisible = true;
  247. }
  248. counterTimeout = setTimeout(updateCounter, 50);
  249. return;
  250. }
  251. $COUNTER.innerHTML = completedReps;
  252. if (completedReps < targetReps) {
  253. if (timingVisible) {
  254. $TIME.innerHTML = '';
  255. timingVisible = false;
  256. }
  257. if (!showAll) {
  258. // Adjust cycleReps so counter is updated every second-ish
  259. if (prevCycleReps != cycleReps) {
  260. // cycleReps too low
  261. if (+new Date() - cycleTime < 1e3) {
  262. prevCycleReps = cycleReps;
  263. if (cycleLimit) {
  264. cycleReps += ((cycleLimit - cycleReps) / 2);
  265. } else {
  266. cycleReps *= 2;
  267. }
  268. // cycleReps too high
  269. } else {
  270. cycleLimit = cycleReps;
  271. cycleReps -= ((cycleReps - prevCycleReps) / 2);
  272. }
  273. cycleReps = Math.floor(cycleReps) || 1;
  274. cycleTime = +new Date();
  275. }
  276. if (completedReps + cycleReps > targetReps) {
  277. cycleReps = targetReps - completedReps;
  278. }
  279. }
  280. completedReps += cycleReps;
  281. calcTimeout = setTimeout(calc, 0);
  282. // Finished - show timings summary
  283. } else {
  284. $START.innerHTML = 'Start';
  285. $COUNTER.style.textDecoration = 'underline';
  286. if (!showAll) {
  287. showTimings();
  288. }
  289. }
  290. },
  291. calc = function () {
  292. var start, bdT, bnT, bdR, bnR,
  293. xs = [cycleReps],
  294. ys = [cycleReps],
  295. bdRs = [cycleReps],
  296. bnRs = [cycleReps];
  297. // Generate random operands
  298. for (i = 0; i < cycleReps; i++) {
  299. xs[i] = getRandom();
  300. }
  301. if (bdM == 'pow') {
  302. for (i = 0; i < cycleReps; i++) {
  303. ys[i] = Math.floor(Math.random() * (MAX_POWER + 1)) + '';
  304. }
  305. // No second operand needed for abs and negate
  306. } else if (bdM != 'abs' && bdM != 'negate') {
  307. for (i = 0; i < cycleReps; i++) {
  308. ys[i] = getRandom();
  309. }
  310. }
  311. //********************************************************************//
  312. //************************** START TIMING ****************************//
  313. //********************************************************************//
  314. // BigDecimal
  315. if (bdM == 'divide') {
  316. start = +new Date();
  317. for (i = 0; i < cycleReps; i++) {
  318. bdRs[i] = new BigDecimal(xs[i])[bdM](new BigDecimal(ys[i]),
  319. decimalPlaces, rounding);
  320. }
  321. bdT = +new Date() - start;
  322. // GWT pow argument must be of type number. ICU4J pow argument must be of type BigDecimal
  323. } else if (bdM == 'pow' && isGWT) {
  324. start = +new Date();
  325. for (i = 0; i < cycleReps; i++) {
  326. bdRs[i] = new BigDecimal(xs[i])[bdM](+ys[i]);
  327. }
  328. bdT = +new Date() - start;
  329. } else if (bdM == 'abs' || bdM == 'negate') {
  330. start = +new Date();
  331. for (i = 0; i < cycleReps; i++) {
  332. bdRs[i] = new BigDecimal(xs[i])[bdM]();
  333. }
  334. bdT = +new Date() - start;
  335. } else {
  336. start = +new Date();
  337. for (i = 0; i < cycleReps; i++) {
  338. bdRs[i] = new BigDecimal(xs[i])[bdM](new BigDecimal(ys[i]));
  339. }
  340. bdT = +new Date() - start;
  341. }
  342. // BigNumber
  343. if (bdM == 'pow') {
  344. start = +new Date();
  345. for (i = 0; i < cycleReps; i++) {
  346. bnRs[i] = new BigNumber(xs[i])[bnM](+ys[i]);
  347. }
  348. bnT = +new Date() - start;
  349. } else if (bdM == 'abs' || bdM == 'negate') {
  350. start = +new Date();
  351. for (i = 0; i < cycleReps; i++) {
  352. bnRs[i] = new BigNumber(xs[i])[bnM]();
  353. }
  354. bnT = +new Date() - start;
  355. } else {
  356. start = +new Date();
  357. for (i = 0; i < cycleReps; i++) {
  358. bnRs[i] = new BigNumber(xs[i])[bnM](new BigNumber(ys[i]));
  359. }
  360. bnT = +new Date() - start;
  361. }
  362. //********************************************************************//
  363. //**************************** END TIMING ****************************//
  364. //********************************************************************//
  365. // Check for mismatches
  366. for (i = 0; i < cycleReps; i++) {
  367. bnR = bnRs[i].toString();
  368. // Remove any trailing zeros from BigDecimal result
  369. if (isGWT) {
  370. bdR = bdM == 'compareTo' || isIntOnly
  371. ? bdRs[i].toString()
  372. : bdRs[i].stripTrailingZeros().toPlainString();
  373. } else {
  374. // No toPlainString() or stripTrailingZeros() in ICU4J
  375. bdR = bdRs[i].toString();
  376. if (bdR.indexOf('.') != -1) {
  377. bdR = bdR.replace(/\.?0+$/, '');
  378. }
  379. }
  380. if (bdR !== bnR) {
  381. $RESULTS.innerHTML =
  382. '<span class="red">Breaking on first mismatch:</span>' +
  383. '<br><br>' +xs[i] + '<br>' + bnM + '<br>' + ys[i] +
  384. '<br><br>BigDecimal<br>' + bdR + '<br>' + bnR + '<br>BigNumber';
  385. if (bdM == 'divide') {
  386. $RESULTS.innerHTML += '<br><br>Decimal places: ' +
  387. decimalPlaces + '<br>Rounding mode: ' + rounding;
  388. }
  389. return;
  390. } else if (showAll) {
  391. $RESULTS.innerHTML = xs[i] + '<br>' + bnM + '<br>' + ys[i] +
  392. '<br><br>BigDecimal<br>' + bdR + '<br>' + bnR + '<br>BigNumber';
  393. }
  394. }
  395. bdTotal += bdT;
  396. bnTotal += bnT;
  397. updateCounter();
  398. };
  399. // Event handlers
  400. document.onkeyup = function (evt) {
  401. evt = evt || window.event;
  402. if ((evt.keyCode || evt.which) == SPACE_BAR) {
  403. up = true;
  404. }
  405. };
  406. document.onkeydown = function (evt) {
  407. evt = evt || window.event;
  408. if (up && (evt.keyCode || evt.which) == SPACE_BAR) {
  409. pause = !pause;
  410. up = false;
  411. }
  412. };
  413. // BigNumber methods' radio buttons' event handlers
  414. for (i = 0; i < 9; i++) {
  415. $INPUTS[i].checked = false;
  416. $INPUTS[i].disabled = false;
  417. $INPUTS[i].onclick = function () {
  418. clear();
  419. lastRounding = $R.options.selectedIndex;
  420. $DIV.style.display = 'none';
  421. bnM = bnMs[this.id];
  422. $BD.innerHTML = bdM = bdMs[this.id];
  423. };
  424. }
  425. $INPUTS[1].onclick = function () {
  426. clear();
  427. $R.options.selectedIndex = lastRounding;
  428. $DIV.style.display = 'block';
  429. bnM = bnMs[this.id];
  430. $BD.innerHTML = bdM = bdMs[this.id];
  431. };
  432. // Show/hide BigInteger and disable/un-disable division accordingly as BigInteger
  433. // throws an exception if division gives "no exact representable decimal result"
  434. $INT.onclick = function () {
  435. if (this.checked && $GWT.checked) {
  436. if ($INPUTS[1].checked) {
  437. $INPUTS[1].checked = false;
  438. $INPUTS[0].checked = true;
  439. $BD.innerHTML = bdMs[$INPUTS[0].id];
  440. $DIV.style.display = 'none';
  441. }
  442. $INPUTS[1].disabled = true;
  443. $BIGINT.style.display = 'inline';
  444. } else {
  445. $INPUTS[1].disabled = false;
  446. $BIGINT.style.display = 'none';
  447. }
  448. };
  449. $ICU4J.onclick = function () {
  450. $INPUTS[1].disabled = false;
  451. $BIGINT.style.display = 'none';
  452. };
  453. $GWT.onclick = function () {
  454. if ($INT.checked) {
  455. if ($INPUTS[1].checked) {
  456. $INPUTS[1].checked = false;
  457. $INPUTS[0].checked = true;
  458. $BD.innerHTML = bdMs[$INPUTS[0].id];
  459. $DIV.style.display = 'none';
  460. }
  461. $INPUTS[1].disabled = true;
  462. $BIGINT.style.display = 'inline';
  463. }
  464. };
  465. BigNumber.config({
  466. DECIMAL_PLACES : 20,
  467. ROUNDING_MODE : 4,
  468. EXPONENTIAL_AT: 1E9,
  469. RANGE: 1E9,
  470. MODULO_MODE: 1,
  471. POW_PRECISION: 10000
  472. });
  473. // Set defaults
  474. $MAX.checked = $INPUTS[0].checked = $GWT.checked = true;
  475. $SHOW.checked = $INT.checked = false;
  476. $REPS.value = DEFAULT_REPS;
  477. $DIGITS.value = DEFAULT_DIGITS;
  478. $DP.value = DEFAULT_DECIMAL_PLACES;
  479. $R.option = DEFAULT_ROUNDING;
  480. BigDecimal_GWT = BigDecimal;
  481. BigDecimal = undefined;
  482. // Load ICU4J BigDecimal
  483. script = document.createElement("script");
  484. script.src = ICU4J_URL;
  485. script.onload = script.onreadystatechange = function () {
  486. if (!script.readyState || /loaded|complete/.test(script.readyState)) {
  487. script = null;
  488. BigDecimal_ICU4J = BigDecimal;
  489. $START.onmousedown = begin;
  490. }
  491. };
  492. document.getElementsByTagName("head")[0].appendChild(script);
  493. /*
  494. NOTES:
  495. ICU4J
  496. =====
  497. IBM java package: com.ibm.icu.math
  498. pow's argument must be a BigDecimal.
  499. Among other differences, doesn't have .toPlainString() or .stripTrailingZeros().
  500. Exports BigDecimal only.
  501. Much faster than gwt on Firefox, on Chrome it varies with the method.
  502. GWT
  503. ===
  504. Java standard class library: java.math.BigDecimal
  505. Exports:
  506. RoundingMode
  507. MathContext
  508. BigDecimal
  509. BigInteger
  510. BigDecimal properties:
  511. ROUND_CEILING
  512. ROUND_DOWN
  513. ROUND_FLOOR
  514. ROUND_HALF_DOWN
  515. ROUND_HALF_EVEN
  516. ROUND_HALF_UP
  517. ROUND_UNNECESSARY
  518. ROUND_UP
  519. __init__
  520. valueOf
  521. log
  522. logObj
  523. ONE
  524. TEN
  525. ZERO
  526. BigDecimal instance properties/methods:
  527. ( for (var i in new BigDecimal('1').__gwt_instance.__gwtex_wrap) {...} )
  528. byteValueExact
  529. compareTo
  530. doubleValue
  531. equals
  532. floatValue
  533. hashCode
  534. intValue
  535. intValueExact
  536. max
  537. min
  538. movePointLeft
  539. movePointRight
  540. precision
  541. round
  542. scale
  543. scaleByPowerOfTen
  544. shortValueExact
  545. signum
  546. stripTrailingZeros
  547. toBigInteger
  548. toBigIntegerExact
  549. toEngineeringString
  550. toPlainString
  551. toString
  552. ulp
  553. unscaledValue
  554. longValue
  555. longValueExact
  556. abs
  557. add
  558. divide
  559. divideToIntegralValue
  560. multiply
  561. negate
  562. plus
  563. pow
  564. remainder
  565. setScale
  566. subtract
  567. divideAndRemainder
  568. */
  569. </script>
  570. </body>
  571. </html>