Tag Archives: Logarithm

Mathematically the number of digits in given integer > 0 can be determined with logarithm.

The number of digits in an integer > 0 is

Trunc(Logk(number)) + 1

Trunc comes from the Pascal programming language and means truncation. ”number” is 10 base system number of k base system number.

The idea is to examine how many powers of base system k there is in the number, that is how many times the given number can be divided with the base number until we get number < 1. With this our friend logarithm helps us to determine that. As a reminder, logarithm is reverse operation to power.

Examples:

In 10 base system in number 12345678 there is 7 powers of 10: Trunc(Log1012345678) = 7, the number of digits is 7 + 1 = 8.

The hexdecimal system number 99916 = 245710, Log16 2457 = 2.8156…, the number of digits is 2 + 1 = 3.

Many years ago when I was studying for the second year in the university of Jyväskylä in one sleepless night I somehow invented how to determine logarithm of negative real number, although I had only basic knowledge of complex numbers. And yes, the logarithm of negative real number is, of course, a complex number.

Now to the formula…

Let x ∈ ℜ andx< 0 andk > 1. Now

I was able to prove this formula in less than 30 minutes, about one A4 paper of proof. Next morning I showed my proof to one person at staff of department of mathematics at university of Jyväskylä (Finland). He didn’t find anything wrong in my proof. A tricky part was a situation where there was two variables in one equation in my proof, but the other varibale had as coefficient sin π that equals 0, so the other variable was eliminated from the equation. I don’t have the proof anymore and I don’t really remember any relevant details of my proof other than I used Euler’s formula (*) in some part of the proof that I had become familiar with in course of differential equations.