[refactor] Use uint64_t and std namespace in PoissonNextSend

Co-authored-by: Martin Zumsande <mzumsande@gmail.com>
This commit is contained in:
John NewberyandMartin Zumsande authored and Martin Zumsande committed 2022-01-13 15:55:01 +01:00
1 parent 9e64d69bf7
commit 03cfa1b603
1 file changed
+1 -1
+1 -1
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);
}