Spyke

Syndicated from the fediverse. Read and engage on the original instance.

View original on feddit.org

7 replies

I never knew this fun fact ! I'll try to use it with my students, and see if I this gets me more attention when I give them the trick to compute powers of 2 in your head (2^10^ =~ 10^3^, which leads to ln(10^3^) =~ 10*ln(2) ).

For anyone wondering, the trick is : Powers of 2 below 10 are easy enough to remember or just compute in your head. So if you want to approximate 2^x^, write it as (2^10a^)(2^b^), with a=x//10 (integer division) and b=x%10 (modulo). b will be 9 or less, so 2^b^ is easy to compute, and 2^10*a^ = (2^10^)^a^ =~ 1000^a^ is also easy to compute.

For instance, 2^32^ = (2^30^)(2^2^). Since 2^30^=1000^3^ ; and 2^2^=4, then 2^32^ = 4(1000)^3 = 4 billion. Once you get used to it, you'll be able to say that 2^64^ is approx 16 billion billions in no time ! :)

14
mkwtreply
lemmy.world

math.h provides log() for the natural logarithm, and log10() for the common logarithm. There is no ln() unless you write it yourself.

3

o.o I had completely forgotten this.

Next you're going to tell me that strlcpy() is not real. I will not believe you. I will choose not to believe you.

2

on the other hand ln(67) = 4.20469... there certainly is some merit to the new meme number

8

You reached the end

69 rule | Spyke