Skip to content

Commit

Permalink
simplify std::log
Browse files Browse the repository at this point in the history
log / log(2) is log2.

Signed-off-by: Rosen Penev <[email protected]>
  • Loading branch information
neheb committed Nov 17, 2024
1 parent eda7171 commit d2532eb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ std::istream& fromStreamToRational(std::istream& is, T& r) {
char F = 0;
float f = 0.F;
is >> F >> f;
f = 2.0F * std::log(f) / std::log(2.0F);
f = 2.0F * std::log2(f);
r = Exiv2::floatToRationalCast(f);
} else {
int32_t nominator = 0;
Expand Down

0 comments on commit d2532eb

Please sign in to comment.