Skip to content

Commit

Permalink
Fix getStartString()
Browse files Browse the repository at this point in the history
  • Loading branch information
kimwalisch committed Feb 12, 2024
1 parent 5ffe615 commit a95752a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/app/stressTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "CmdOptions.hpp"

#include <stdint.h>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <iomanip>
Expand Down Expand Up @@ -184,8 +185,9 @@ std::string getStartString(uint64_t start)
return std::string();
else
{
std::size_t size = std::to_string(start).size();
return "1e" + std::to_string(size) + "+";
double log10_start = std::log10(start);
int exponent = (int) std::round(log10_start);
return "1e" + std::to_string(exponent) + "+";
}
}

Expand Down

0 comments on commit a95752a

Please sign in to comment.