1 2 #include <iostream> 3 #include <limits.h> 4 #include <gmpxx.h> 5 6 using namespace std; 7 8 9 int main(int argc, char **argv){ 10 unsigned long int i,j; 11 // 4294967295 12 13 for (i=1;i<4294967295UL;i*=2){ 14 j=0; 15 mpf_class epsilon(0.5,i); 16 17 while(epsilon+1 != 1){ 18 //cout.precision(200000); 19 //cout<<"Epsilon: "<<epsilon<<endl; 20 epsilon /= 2; 21 j++; 22 }; 23 cout.precision(20); 24 // cout<<"Precision: "<<ULONG_MAX<<endl; 25 cout<<"Epsilon Final: "<<epsilon<<" Numero de ciclos: "<<j<<" Precision: "<<i<<endl; 26 } 27 28 return 0; 29 }
You need to create an account or log in to post comments to this site.