log is non-monotonic in PHP and Lua

If a > b > 1 and x > 1 , you can prove that log a ⁡ x < log b ⁡ x . (As a reminder, log a ⁡ x denotes the value t such that x = a t .) This is very intuitive if you think about it: for “normal” numbers, the greater a , the smaller t you will need to get the same x . Yet if you ask PHP what it thinks, it will tell you you’re wrong in a couple rare cases: <?php $x = 2.93 ; $a = 10 + 2 ** - 49 ; $b =…