Skip to content

Unify the use of std::log and std::log2 #1068

@ZenithalHourlyRate

Description

@ZenithalHourlyRate

This is only for clean-up and no functional change.

In the codebase, there are various places that use log() / log(2) and some places mix the use of log and log2. One example is

// logq = log(...)
double loge = logq / log(2) - 2 - log2(p);

This makes the code a bit harder to understand. One easy way is to use std::log2 in all places as it seems more natural in this area.

There are some places that use different log base, such as log(Q.ConvertToDouble()) / log(static_cast<double>(baseKS))). This is not affected by whether we are using log2 or log.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions