Log is non-monotonic in PHP and Lua
ibobev
19 points
11 comments
July 23, 2026
Related Discussions
Found 5 related stories in 353.4ms across 14,736 title embeddings via pgvector HNSW
- Wide logging: Stripe's canonical log line pattern alcazar · 21 pts · March 18, 2026 · 48% similar
- Not all elementary functions can be expressed with exp-minus-log mmastrac · 43 pts · April 15, 2026 · 43% similar
- Everything is logarithms E-Reverance · 178 pts · June 21, 2026 · 43% similar
- Game Boy Advance Dev: Logging to the Console jandeboevrie · 31 pts · July 04, 2026 · 42% similar
- Log File Viewer for the Terminal wiradikusuma · 294 pts · March 24, 2026 · 41% similar
Discussion Highlights (4 comments)
dmitrygr
> you can compute any logarithm from two base-e ones. They need not be base e. Any base will do as long as it is the same for both the numerator and the denominator
lioeters
Recently I was reading an article on the EML operator (exp-min-log) that uses exponentiation and logarithm to build elementary math functions including arithmetic operations. There was a table of results from testing across languages. Language Result of 2 x 3 Error --- Node.js v25.3.0 6.000000000000000 0 Python 3.9.6 6.000000000000001 8.88e-16 PHP 8.5.1 6.000000000000001 8.88e-16 Go 1.26.2 6.000000000000000 0 Rust 6.000000000000001 8.88e-16 It was speculated that this miniscule margin of error, 1 ULP (unit in the last place), is likely due to the difference in how log() is implemented by the language. Supposedly Python, PHP, and Rust use LLVM's libm (C math library) but maybe Go and Node.js internally compile to CPU instructions directly? There was no evidence presented, so I was skeptical of this explanation.
cwt137
I find it interesting the blog author tied PHP and Lua together. PHP uses a JIT from Lua. Is this related to the log issue?
kristianp
Wouldn't a more applicable title be that the log base is non-monotonic?