I am aware of racket's log
function, which computers the natural logarithm of a number. I am trying to find the logarithms of numbers raised to arbitrary bases. In other words, instead of this:
> (log 9)
2.1972245773362196
I would like to do something similar to this:
> (logarithm 3 9)
2
Is there a function anyone knows about either builtin to Racket or available in a module from PLaneT I can use like this?
Use math: logk n = ln n / ln k:
(/ (log 9) (log 3))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With