log is non-monotonous in PHP and Lua

126 · Alisa Sireneva · July 22, 2026, 9:06 a.m.
Summary
This blog post discusses an interesting anomaly in the logarithmic function in PHP with respect to certain specific values. It showcases a case where, contrary to mathematical intuition, the log function does not behave monotonically due to how PHP handles floating-point arithmetic, providing insights that go beyond typical discussions of floating-point precision.