redundant-log-base (FURB163)#
Derived from the refurb linter.
Fix is sometimes available.
This rule is unstable and in preview. The --preview
flag is required for use.
What it does#
Checks for math.log
calls with a redundant base.
Why is this bad?#
The default base of math.log
is e
, so specifying it explicitly is
redundant.
Instead of passing 2 or 10 as the base, use math.log2
or math.log10
respectively, as these dedicated variants are typically more accurate
than math.log
.
Example#
Use instead: