News for hackers. Stuff that matters.
Re:New Proof Dramatically Compresses Space Needed for Comput... by zombot on Monday June 30, 2025 @08:19AM (#44422352)
> log(t)

log to what basis? 2 or e or 10 or...

Why do programmers have to be so sloppy?

Re:New Proof Dramatically Compresses Space Needed for Comput... by anonymous_sorry on Monday June 30, 2025 @09:15AM (#44422905)
It's not sloppiness, it's economy.

You can convert between log bases by multiplying by a constant factor. But any real-world program will also have a constant factor associated with it, depending on the specific work it is doing and the hardware it is running on. So it is usually pointless to consider constant factors when theorising about computer programs in general.

Re:New Proof Dramatically Compresses Space Needed for Comput... by 12345ieee on Monday June 30, 2025 @08:20AM (#44422370)
It doesn't matter in O() notation.
Re:New Proof Dramatically Compresses Space Needed for Comput... by derbOac on Monday June 30, 2025 @09:17AM (#44422929)
One answer, from a certain perspective, is that it's relative to your encoding base. It's logarithmic in operations, with the base depending on the encoding.
Re:New Proof Dramatically Compresses Space Needed for Comput... by eviks on Monday June 30, 2025 @08:58AM (#44422742)
Another reason is because base e notation is ln, not log
Re:New Proof Dramatically Compresses Space Needed for Comput... by tzs on Monday June 30, 2025 @11:13AM (#44424343)
It depends on the field.

For example in programming base e is more common. For example log is base e in C/C++, JavaScript, Java, Python, Perl, Mathematica, Fortran, and Rust.

Another example is number theory. I just checked a few number theory books from my library and most used base e: Hardy & Wright's "An Introduction to the Theory of Numbers", Apostol's "Introduction to Analytic Number Theory", Baker's "A Comprehensive Course in Number Theory", Ingham's "The Distribution of Prime Numbers", Baker's "Transcendental Number Theory", Ribenboim's "The Book of Prime Number Records", Kumanduri & Romero's "Number Theory with Computer Applications", and Niven's "Irrational Numbers".

The only number theory book I found using ln rather than log was Gelfond's "Transcendental & Algebraic Numbers".

Re:New Proof Dramatically Compresses Space Needed for Comput... by eviks on Monday June 30, 2025 @11:28AM (#44424501)
That confusion is unfortunate, thanks for checking the books!

Am now a bit curious as to what the country/scientific field table with most common log notation would look like as it seems there is indeed a lot of variance...

https://mathworld.wolfram.com/Ln.html

> The United States Department of Commerce recommends that the notation lnx be used in this way to refer to the natural logarithm (Taylor 1995, p. 33).

> Unfortunately, mathematicians in the United States commonly use the symbol logx to refer to the natural logarithm, as does TraditionalForm typesetting in the Wolfram Language

Re:New Proof Dramatically Compresses Space Needed for Comput... by tempodox on Monday June 30, 2025 @11:03AM (#44424223)
If only! The math libs I know use the name `log` for base e logarithm, not `ln`.
Re:New Proof Dramatically Compresses Space Needed for Comput... by eviks on Monday June 30, 2025 @11:07AM (#44424277)
hm, you're right, this unfortunatley proves the original point...
Re:New Proof Dramatically Compresses Space Needed for Comput... by Tarq0n on Monday June 30, 2025 @08:34AM (#44422485)
This is very common. Log without further specification can be assumed to be the natural log (log e).
Re:New Proof Dramatically Compresses Space Needed for Comput... by holowoodman on Monday June 30, 2025 @09:11AM (#44422859)
No. Usually log without further specification is base10.

Except in mathematics and physics, where it usually is base e.

Except sometimes in computer science, where it can be base 2.

But there are more of those weirdnesses: "ld" can be "log decimal", so base 10; or "logarithmus dualis", so base 2. Base 2 is also sometimes written as "lb" (log binary). You really need to know the conventions of the field/subfield to know which is which.

Re:New Proof Dramatically Compresses Space Needed for Comput... by eru on Monday June 30, 2025 @11:46AM (#44424688)
Log without a basis (at least to me) usually indicates that the basis doesn't matter in this context (or is obvious).

I usually see either base e or base 2 as the default. In which applications do people use both logarithms and base 10 as the default? I mean, especially these day. In the olden days of the slide ruler base 10 was probably more common.

Re:New Proof Dramatically Compresses Space Needed for Comput... by holowoodman on Monday June 30, 2025 @02:47PM (#44426557)
> In which applications do people use both logarithms and base 10 as the default?

Engineering. For example dB is defined in base 10.

Re:New Proof Dramatically Compresses Space Needed for Comput... by gbacon on Monday June 30, 2025 @03:28PM (#44426960)
Base 2 is also sometimes abbreviated lg.
Re:New Proof Dramatically Compresses Space Needed for Comput... by mort96 on Monday June 30, 2025 @09:53AM (#44423290)
In this case, and in many other cases, log without further specification is meant to be understood as just "it is logarithmic" without further specification. With big O, we don't differentiate between log bases, just as we don't differentiate between scale factors. In fact, converting from one log base to another is just multiplying by a constant.
Re:New Proof Dramatically Compresses Space Needed for Comput... by griffzhowl on Monday June 30, 2025 @08:36AM (#44422511)
In information theory it usually means log base 2
Re:New Proof Dramatically Compresses Space Needed for Comput... by eviks on Monday June 30, 2025 @08:59AM (#44422753)
no, that's what ln is for
Re:New Proof Dramatically Compresses Space Needed for Comput... by thaumasiotes on Monday June 30, 2025 @04:30PM (#44427512)
Well, you're right that that's what "ln" is for. But more specifically "ln" is for indicating the natural log on calculators that already have another button labeled "log". Tarq0n is correct that "log" without further specification can be assumed to be the natural log.