First version with advanced algorithm
This commit is contained in:
19
al_utility.cpp
Normal file
19
al_utility.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#include "al_utility.hpp"
|
||||
|
||||
bool print_progress(long current, long total, double print_every) {
|
||||
long integer_part = total * print_every;
|
||||
if ( current % integer_part != 0 )
|
||||
return false;
|
||||
|
||||
// сделаем потокобезопасным
|
||||
std::stringstream ss;
|
||||
ss << "Progress " << current << " of " << total
|
||||
<< " " << std::fixed << std::setw(5) << std::setprecision(2)
|
||||
<< 100. * current / total << "%" << std::endl;
|
||||
std::cout << ss.str();
|
||||
return true;
|
||||
}
|
||||
|
||||
int get_math_coeff(int k) {
|
||||
return static_cast<int>(pow(1.4, k + 2));
|
||||
}
|
||||
Reference in New Issue
Block a user