3 ms·
For common cases of n=2 and n=10, consider using dedicated functions log2() and log10(), because they are more precise. For example: log(1E42)/log(10) == 42
by jwilk 9y ago
For common cases of n=2 and n=10, consider using dedicated functions log2() and log10(), because they are more precise. For example:
log(1E42)/log(10) == 42 - 7.105427357601002e-15
log10(1E42) == 42.0
- 52-6F-62 9y agoNoted. It’s more for other cases. While doing any algebra coursework I usually (loosely) confirm my thoughts by running them in a repl with said functions to at least keep me on track— so logn usually serves uncommon bases. My thinking that way might not make much sense, but I start to explain it in other comments. Anyway— thanks, I appreciate the insights. That’s the reason I like this forum