It appears that the precision setting for PHP may be set
inconsistently across the WMF server pool.
PHP's internal floating point format is the same as a C double giving
~15 digits of precision. By default, current versions of PHP display
14 digits when rendering numbers for output. This is controlled by a
"precision" setting in php.ini that defaults to 14.
Operations like {{#expr:1.11111111111222}} on Wikipedia usually
displays 14 digits, but every so often the parser will uniformly
truncate all calls to #expr: to only 12 digits (i.e. for the example
given, you get "1.11111111111" without the "22" at the end). The
easiest way to understand this would be if a few of the servers have
"precision=12" set in php.ini.
By performing tests like: {{#expr:1.11111111111222-1.11111111111}} it
appears that in all cases the server is aware of those extra digits
and able to perform operations involving them, but it simply chooses
not to display them if it leads to too high a displayed precision.
The fact that the servers all seem to operate on the digits correctly
would suggest that this is a variation in software rather than some
more fundamental variation in hardware, and supports my theory that
this is caused by inconsistent configuration settings.
Would someone be willing to check whether some of the servers are set
to precision=12 and others to precision=14? I'm not sure if it is
useful, but I made a point of capturing the "Served by" comment a
couple times when I saw truncation to 12 digits. This included srv112
and srv176.
If there is variation in this PHP setting across the servers, then I
think one or the other setting should be adopted universally unless
there is some good reason not to. Since getting 14 digits seems to
happen most of the time right now, that would seem to be the natural
choice.
-Robert Rohde