# The most interesting logs in the world

I occasionally get comments from people who see “log” in one of my posts and think “log base 10.” They’ll say they get a different result than I do and ask whether I made a mistake. So to eliminate confusion, let me explain my notation.

When I say “log,” I always mean natural log, that is, log base e. This is the universal convention in advanced mathematics. It’s also the convention of every programming language that I know of. If I want to use logarithms to a different base, I specify the base as a subscript, such as log10 for log base 10.

The reason logs base e are called natural, and the reason they’re most convenient to use, is that base e really is natural in a sense. For example, the function kx is its own derivative only when k = e. And the derivative of logk(x) is 1/x only when k = e.

All logarithms are proportional to each other. That is, logb(x) = loge(x) / loge(b). That’s why we can say something is logarithmic without specifying the base. So we might as well pick the base that is easiest to work with, and most people agree that’s base e. (There are some exceptions. In computer science it’s often convenient to work with logs base 2, sometimes written lg.)

Logarithms base 10 have the advantage that they’re easy to compute mentally for special values. For example, the log base 10 of a 1,000,000 is 6: just count the zeros. So it’s good pedagogy to introduce logs base 10 first. But natural logs are simpler to use for theoretical work, and just as convenient to compute numerically.

Along these lines, when I use trig functions, I always measure angles in radians. Just like all advanced mathematics and all programming languages.

As with natural logs, radians are natural too. For example, the derivative of sine is cosine only when you work in radians. If you work in degrees, you pick up a proportionality constant every time you differentiate a trig function.

Natural logs and radian measure are related: Euler’s formula eix = cos(x) + i sin(x) assumes the base e and assumes that x measured in radians.

Related post: Relating lg, ln, and log10

## 67 thoughts on “The most interesting logs in the world”

1. Is the abbreviation lg for log base 2 common in the English-speaking world? I was taught the abbreviation ld for logarithmus dualis.

2. My impression is that lg is moderately common. I think it’s more common to just use “log” and say parenthetically that log will mean log 2. I don’t recall seeing ld.

3. @Chris: The “lg” notation is somewhat common. It’s what you’re supposed to use for the log base 2 according to the Chicago Manual of Style. However, every time I’ve used it in a paper, the MS comes back from the reviewer telling me to change it to log_2, so I think there’s not a consensus on that. (That includes journals that explicitly tell authors to use the Chicago Manual of Style.)

In computer science of course you just say “log”, without reference to the base, because all logs have the same big-O behavior due to that handy proportionality fact John referenced.

4. Adrien Lamarque

In my (french) education, we were taught to use ln for the natural logarithm (it’s the abbreviation of logarithme népérien, in reference to John Napier), and to use log for base 10. I don’t really know if it’s one of the quirkness of the french mathematical notation. We use the subscript notation as well.

5. scand1sk

I do not know if it is a French convention, but I often see natural logarithm (we also call Neper logarithm) abbreviated as ln. Thus, the log abbreviation usually refers to base 10 logarithm…

6. Andrien: I’ve seen the same notation in America in elementary education. And it’s unfortunate. “log” means one thing in high school and another in college.

In my opinion, pre-calculus math classes should always denote logarithms with a subscript indicating the base. Then announce in calculus that when there is no subscript, base e is implied.

7. Brian Krent

I’ve been using, and continue to use, “log” for log base 10 and “ln” for log base e.

8. Brian Krent

Apparently the ISO notation is “ln” for natural log, “lg” for common log, and “lb” for binary log.

9. Right, I was also taught ln for log base e. I’ve occasionally seen lg but didn’t realize it’s standard for base 10. I must admit that I’ve never even heard of lb!

10. In Brasil we are also taught that ln is the abbreviation for logarithm with base e, and that log is the generic abbreviation for logarithm (with base 10 if not specified). And that is not just basic school, the same notation was used trough all my calculus courses in university.

11. Dave Tate

Awesome. I sent a copy of the first photo to a colleague of mine who used log10 in some work for me last month. (Physicists… )

12. I always use ln for natural logs and log for base 10. But then, I’ve done most of my teaching in French with French textbooks, so I’m probably influenced by those conventions. I can’t remember what we learned in American schools.

13. In France mathematics school, the natural logarithm notation is ln, and log is used for base 10 logarithm. It avoid any confusion.
Note that ln stands for “Logarithme Naturel”, ie natural logarithm.

14. Mikarnage

I’d like to add (same idea, but with physics) :
Lengths are in meters (not feet, inches or whatever)
Speeds are in meters per second (not miles per hour)
Energy is in Joules (not kiloCalories)

… or else E = M*C^2 is wrong, too ;)

15. Greece: ln for base e, log for base 10. Sometimes I’ve seen log for base 2 too but in those cases the context is clear.

16. Just make sure you don’t use “log” in Excel – you’ll get base 10 logarithms! But then, who would use Excel!

17. Same as others here, in Canada we were taught that “log” is log base 10 and “ln” for log base e.

You mentioned your convention is universally accepted in advanced mathematics. Perhaps the confusion stems from a difference between the advanced and novice education?

18. Jared: Yes, I think it has to do with pre-calculus vs post-calculus math. I have never seen log mean anything other than natural log in a post-calculus math book or article, regardless of the nationality of the author or publisher.

19. I’m an American, and I’d like to confirm John’s observation about the convention in advanced mathematics. Using log to refer to log_10 or using ln to specify base e is a clear signal that you have no experience in the basics of advanced mathematics such as real or complex analysis.

Commentors have been declaring their nationality, but not their level of mathematics experience. I’m guessing that the log/ln crowd are folks (from every nation) that didn’t take much math beyond calculus.

20. Johnathan

Victim of American K-12 public school here. We were taught “ln” for base e, “log” for base 10, and to use “log” and a base subscript for anything else.

21. Johnathan

@Eric Wilson – yes, not much past ordinary differential equations, some number theory. So maybe the notation taught to us plebes is designed to help identify and separate “real” mathematicians from uppity CS majors who don’t know their place :)

22. I’m a grad student inUSA and through high school and undergrad ln was natural log and log was shorthand for base 10. As a grad student I’ve only seen log as natural log. Using ln as much as I like it does a disservice to math and students as it adds an extra layer of confusion.

23. Careful if you deal with chemistry; we use ln for base e, and log for base 10, because usually we want to scale things in base 10 on a graph or something, rather then advanced mathematical analysis.

We also freely mix Joules and kcal, because 100 kcal is close enough to the strength of a carbon-hydrogen bond that it is easy to get a mental image of the strength of the energy. We’ll also use electronvolts if we wind up hanging out with physicists too much or start straying into the nuclear realm.

Of course, we also have two opposite sign conventions for one of our basic equations (Free energy), so we aren’t the most reliable people ever.

24. Rick DeNatale

It’s been a while since I was in school, I got my BSEE/CompSci in 1974, and my first programming language (of many) was FORTRAN II on an IBM 1620. I also remember log for the common (base 10) log and ln for natural logs.

Just what log means seems to depend on your field or culture, better to use ln and lg for unambiguity in a ‘mixed’ audience.

It’s kind of like the way that most fields use ‘i’ for the square root of -1, except for electrical engineers who use ‘j’ since ‘i’ is used for current. In college I needed to mentally translate depending on whether I was in an EE or math course.

25. I think insistence of one base or another for “log” is a somewhat provincial attitude… Often the base is not important, and in other circumstanced the base is usually clear from context. Mathematicians and physics will generally mean base-e, but information theorists and communications engineers more often mean base-2. Any field where they don’t need to take derivatives or reduce things to bits probably work in base-10.
One rarely needs to mix bases, so being a context dependent term is just fine.

26. Dave Tate

Eric, I think you have it sideways. Using “ln” for natural log isn’t a sign that you never got to advanced math; it’s a sign that you sometimes work with (or teach!) people who didn’t, or haven’t yet. Easy clarity is never wrong.

27. Calculators also seem to use ‘ln’ for base e and ‘log’ for base 10. (This could be a level of education aspect.)

28. Your explanation for why radians are more natural than degrees seems odd to me. (Intuitively, to me it seems like a consequence of naturalness rather than a reason for it. But maybe we’re consequentalists about such things…I dunno.)

My impression was that radians are ‘natural’ because for any circle, the number of times its radius can be wrapped around it is 2π (c = 2πr). But I’m a novice so I dunno.

I’m curious:
In general, what does it mean for a given mathematical concept to be ‘natural’ or more ‘natural’ than another? Is there some set of mathematical or aesthetic criteria people have in mind? (minimality or elegance, e.g.?)

(Assuming one can generalize about it, that is…)

29. Eric, I’d like to agree with Dave. I have an MA in math, so it’s not as if I have no experience with advanced math. I’m sure the same is true of others posting here. But it’s been so long, I honestly don’t remember if I used ln or not. I do know, however, what conventions I’ve grown used to in my teaching since then! In the end, it’s all arbitrary convention, often tailored to the needs of whatever field we’ve gone into, as others have pointed out.

30. A Confused One

In my (german) university, we learned to use ln (from latin: logarithmus naturalis) or log_b. Maybe this is a difference between american and european customs.

31. I couldn’t agree more with GlennF. Simply because a number is its own derivative is pretty lousy reason to use it, especially if 99% of the time, the reason you’re using it has little to do with derivatives. Is anyone integrating or differentiating besides people who already know the difference?
Base e also has the nifty features that it is hard to calculate while simultaneously confusing many people who are not mathophilic (for example, most biologists). And E = MC^2 still works, as long as your units are right…

32. Jimbo: As for what’s natural, I think of it as a coordinate system. In physics, you want to pick the coordinate system in which your problem is simplest. For example, it’s simpler if motion is along an axis rather than having components along two or three axes. Also, it’s sometimes simpler if axes have the same scale.

Euler’s formula

exp(ix) = cos(x) + i sin(x)

is only true when we use the natural base e and radian measure. These are the natural “coordinate system” because that’s the system in which the relationship between these three important functions is the simplest to state. With base 10 and degrees, Euler’s formula says

10^(log10(e) ix) = cos(πx/180) + i sin(πx/180)

Even so, we haven’t escaped e because log10(e) appears in our formula.

If we agree that ex is more natural than 10x, then we should also agree that the inverse of ex is more natural than the inverse of 10x.

33. Pseudonym

Quick response to Robert Talbert.

In computer science of course you just say “log”, without reference to the base, because all logs have the same big-O behavior due to that handy proportionality fact John referenced.

If you’re reporting big-O behaviour, you just say “log”. However, this is only a small part of computer science.

Big-O makes sense for reporting the time that an algorithm theoretically takes, because faster computers are always being produced. Of course, constant factors actually matter; Sedgewick points out that something like 80% of algorithms published in SODA are “galactic algorithms”, in the sense that they are asymptotically faster than the algorithms used today, but the constant factors mean that the speedup will only be realised if you feed it a galaxy’s worth of data.

However, space requirements are a different matter. A bit can be (and regularly is) made physically smaller, but they can’t be theoretically smaller.

Information theory gives us hard limits on how many bits are required to transmit a member of a family of data structures across a communications channel. Transmitting the number N, for example, requires lg N + O(1) bits. The low-order terms are “within a constant factor”, but the high order terms are not.

You can halve the amount of time it takes to transmit, and you can halve the physical size of a container to store it in, but you can’t reduce the number of bits.

And that’s why the base of logarithms still matters in computer science.

34. @eric wilson
I have a PhD and I am an alumni of Ecole Normale Superieure from Paris. you know, this school with eleven Fields medals.

I guess I qualify as having done math past basic calculus.

Note that even wikipedia entry on logarithm uses ln for log_e

What seems clear is that (as often) US have a different convention than the rest of the world.

35. Olin, there are other reasons for preferring the natural log that don’t involve calculus. Our host already mentioned one — the relationship between exponential and trigonometric functions. Here are a few other things that come out nicely with natural logs and don’t with logs to other bases. The number of comparisons to sort n numbers is n log n plus lower-order terms. If you have some money earning a small rate of compound interest, so that every year it multiplies by 1+h, then it takes about log(K)/h years to multiply your money by a factor K. 1 + 1/2 + 1/3 + … + 1/n is log n plus lower-order terms. The n’th prime number is approximately n log n plus lower order terms.

That doesn’t mean there are no situations in which other bases might be preferable, of course, but it isn’t at all the case that the only reason anyone has for preferring natural logs is that they make calculus nicer.

36. A. Webb

Perhaps we pay homage to their inventor and do our logs as log(10^7 / x) / log (10^7 / (10^7-1) ), then both camps can be equally unhappy.

37. Luk Vizner

John you are using a simple math, so there is no reason to use log without the base notation.

38. Spanish Maths grad here. In high school, we get taught to use ln as natural logarithm (we call that «logaritmo neperiano»), and log as base 10 log. However, as you enter university log starts meaning natural logarithm and you rarely see ln. That’s unfortunate because ln is more accurate (and shorter!), it’s also confusing for students in their first year, and in non-maths subjects you can’t really know the convention they’re using (frequently log = base10, like in chemistry as pointed out by @Canageek).

39. ezra abrams

isn’t it surprising how every specialist has some reason why there way is the right way , and why there speciality is somehow better then others
I read several times in my undergrad math/chem/biol/physics books about how X was the supreme achievement of the human mind…..

Respectfully, take a chill pill here – what matters, at least for the 98% of non math majors, is that the world have a consistent and universally applied standard; it doesn’t matter all that much what it is.
In my world, biology, Log = base10 and Ln= base 2 or e
please, why don’t you get together with the guys who think differently, toss a coin, and decide on a standard.

40. David Feuer

I’m only an undergrad (studying math), but I tend to use “ln” for natural logarithms. I don’t remember the last time I saw a base-10 logarithm—I mostly see log used to mean base 2, when I read CS papers. It seems to me that within CS, where the vast majority of logarithms are either natural or base 2, that it would be awfully nice to adopt a convention for writing base 2 logarithms to avoid the boilerplate “All logarithms in this article are base 2 unless otherwise specified.” I also see no reason to prefer the generic “log” to the specific “ln”, aside from snootery: if it’s more important to you to insist that log means log_e than to make yourself clear even to people beneath your lofty heights, then maybe you should switch from math to literary criticism, where such behavior is more widely appreciated.

41. In Croatia we use “log” for base 10, and “ln” for base e.

As far as I know your statement “(log log base 10) is the UNIVERSAL convention in advanced mathematics.” is true only if the UNIVERSAL is equivalent to “english speaking world”.

42. Marko: Please note that I said advanced mathematics.

Elementary math books often use log as you say, in English speaking countries and around the world. But I have never seen a mathematics journal article, for example, that writes “log” and implicitly means “log_10”.

43. No, I think you’re plain weird. We also use ln in Romania. What you’re stating is just an expression of the English way of refusing standards.

44. My, what a lot of comments! Out of curiosity I did a very unscientific poll of the first few articles (in English) I had access to when doing a Google Search of “logarithm”. Two were on discrete logs, the other two used log base e. Of the two that used log base e, one used the notation “log” without writing the base. The other used “ln”. None referred to log base 10.

45. Pseudonym

(In what follows, I’m using ln to mean log base e, and lg to mean log base 2.)

Actually, g, the number of comparisons required to sort n items using only binary comparisons is n lg n plus low order terms, not n ln n.

This follows from basic information theory. You are trying to “discover” a number between 1 and n!. A binary comparison gives you one bit of information. You need at least lg (n!) + O(1) bits of information to discover this number, and therefore need at least lg (n!) + O(1) comparisons to do the sort.

It’s then a matter of using Stirling’s approximation or something similar to get this in whatever form you need:

lg (n!) + O(1) = n lg n + O(n) = (1 + o(1)) n lg n

46. Pseudonym: Elegant explanation of sorting complexity. Thanks.

47. Wow, it’s absolutely unexpected to see so much confusion about these things!
I guess national specifics does have a role. E.g. in former USSR countries:
log is for any base
lg is for base 10
ln is for base e

On my scentific calculator (made in China, obviously), there are separate buttons which are marked as follows:

log_a so that one could specify any base,
log for base 10
ln for base e

The Wikipedia article about the decadic logarithm says this:

On calculators it is usually “log”, but mathematicians usually mean natural logarithm rather than common logarithm when they write “log”. To mitigate this ambiguity the ISO specification is that log_10(x) should be lg (x) and log_e(x) should be ln (x).

I admit I don’t do math daily but I would stick with these standards so as not to complicate things.

48. David Feuer

Yuliya, as others have noted, following the ISO standard doesn’t really help anything in this case, as log_2 is most often written ld, lg, or (when specified) log, but the ISO standard specifies lb for this, which few will recognize, and lg for log_10, which many will mistake for log_2. It seems that must have been an after-the-pub kind of decision.

49. I agree with your comments completely, but I think you left one item out.

In the interest of consistency (“use what makes the most sense”) then you should define Pi as 3.283….

It fits much more naturally into the world of logs of e and radian measurement.

50. Maël Primet

@EricWilson @JeanFrancoisPuget

Yes I think the debate here is really about national conventions, I’m also a PhD, also from the Ecole Normale Supérieure in Paris (I remind you that Americans are still measuring sticks with inches…) and in France we actually consider poor education to use `log` without subscript (as the log without base is only defined up to a constant, as it was remarked), and we will always use `ln` to denote the natural logarithm.

Comments are closed.