SHARE
TWEET

Problem 8 Sum Huge numbers

a guest Jul 23rd, 2014 283 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var BigNumber = require('./bignumber.js');
  2. function sumTwoHugeNumbers(arr) {
  3.    
  4.     var digOne = new BigNumber(arr[0]);
  5.     var digTwo = new BigNumber(arr[1]);
  6.     var sum = new BigNumber(digOne + digTwo);
  7.     return sum;
  8. }
  9. console.log(sumTwoHugeNumbers(['347135713985789531798031509832579382573195807',
  10.  '817651358763158761358796358971685973163314321']
  11. ));
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top