[refactor] Use uint64_t and std namespace in PoissonNextSend

Co-authored-by: Martin Zumsande <mzumsande@gmail.com>
This commit is contained in:
John Newbery
2020-05-08 13:30:55 -04:00
committed by Martin Zumsande
parent 9e64d69bf7
commit 03cfa1b603

View File

@@ -718,6 +718,6 @@ void RandomInit()
std::chrono::microseconds PoissonNextSend(std::chrono::microseconds now, std::chrono::seconds average_interval)
{
double unscaled = -log1p(GetRand(1ULL << 48) * -0.0000000000000035527136788 /* -1/2^48 */);
double unscaled = -std::log1p(GetRand(uint64_t{1} << 48) * -0.0000000000000035527136788 /* -1/2^48 */);
return now + std::chrono::duration_cast<std::chrono::microseconds>(unscaled * average_interval + 0.5us);
}