I made a program that computes a factorial of a number.
#include<iostream>
#include<fstream>
#include<cmath>
#include<iomanip>
#include<string>
using namespace std;
//unsigned __int64 Fact(unsigned __int64 x );
int main(){
unsigned __int64 num = 100;
unsigned long double fact(1);
for(unsigned __int64 i=1;i<=num;i++)
{
fact *=i;
cout<<setprecision(50)<<"i is : "<<i<<" fact is : "<<fact<<endl;
}
return 0 ;
}
The problem is I can't convert 100! into all of its significants digits. The output is 9.3326215443944102 e+157;
How could I get all the number to show. "setprecision" dosen't work here.
any help ???