20 lines
584 B
C++
20 lines
584 B
C++
#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));
|
|
}
|