Skip to content

Commit

Permalink
fix pow
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffhammond committed Nov 13, 2023
1 parent c7d6861 commit 3ba0908
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Cxx11/prk_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -413,12 +413,13 @@ namespace prk {
{
const auto d = std::log10(rate);
const int shifts[6] = { 15, 12, 9, 6, 3, 0 };
const double scales[6] = { 1.e-15, 1.e-12, 1.e-9, 1.e-6, 1.e-3, 1. };
const char prefix[6] = { 'P', 'T', 'G', 'M', 'K', ' ' };
for ( int r=0; r<6; r++ ) {
const auto shift = shifts[r];
if (d > shift) {
std::cout << name
<< " Rate (" << prefix[r] << "F/s): " << std::pow(1.0,-shift) * rate
<< " Rate (" << prefix[r] << "F/s): " << scales[r] * rate
<< " Avg time (s): " << time << std::endl;
break;
}
Expand Down

0 comments on commit 3ba0908

Please sign in to comment.