Advertisement
thecplusplusguy

bignum library - test1.cpp - calculate 1000 factorial

Jul 6th, 2012
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.50 KB | None | 0 0
  1. //a bignum library written in C++, it can (in theory) calculate with 4 billion digit long numbers
  2. //this is mostly for demonstration purposes, if you need performance, use something like GNU arbitrary precision library
  3. //Implemented by: http://www.youtube.com/user/thecplusplusguy
  4. //this might be an older version, I have to check
  5. //calculate 1000 factorial
  6. #include <iostream>
  7. #include "bignum.h"
  8.  
  9. int main()
  10. {
  11.     bignum fact=1;
  12.     for(int i=1;i<=1000;i++)
  13.         fact*=i;
  14.     std::cout << fact << std::endl;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement