experiments/MPI/11.exp/main.cpp
/* calculates exp without using any parallel routines */
calculates exp without using any parallel routines
calculates exp without using any parallel routines
int calculateExp(int Precision) {
   int SeriesSize = getSeriesSize(Precision);
   mp::mpf_float::default_precision(Precision);
   mp::mpf_float Sum = 1;
   mp::mpf_float Denom = 1;
   for (int I = 1; I <= SeriesSize; ++I) {
      Denom *= I;
      Sum += 1 / Denom;
   }
   std::cout << Sum.str(Precision) << std::endl;
   return 0;
}
int calculateExp ( int Precision ) { int SeriesSize = getSeriesSize ( Precision ) ; mp :: mpf_float :: default_precision ( Precision ) ; mp :: mpf_float Sum = 1 ; mp :: mpf_float Denom = 1 ; for ( int I = 1 ; I <= SeriesSize ; ++ I ) { Denom *= I ; Sum += 1 / Denom ; } std :: cout << Sum . str ( Precision ) << std :: endl ; return 0 ; }
calculates exp without using any parallel routines
calculates exp without using any parallel routines