Would it make sense if `log(x, base)` took a defau...
# stdlib
k
Would it make sense if
log(x, base)
took a default value of
E
for
base
so as to make
log(x)
work just as it does in Java, C, and most other languages, instead of requiring the base to be explicitly passed? It would also form a counterpart of
exp(x)
which already implicitly uses a base of
E
.
🤔 1
i
For common bases we provide
log10
,
log2
, and
ln
(base E) functions.
I don't think it's correct to say that
exp(x)
uses
E
base implicitly because there's no way to make it use other base explicitly. There's
pow
function for raising to the power of arbitrary bases.
k
Thanks, I had forgotten about the
ln
function.