On Wed, Feb 11, 2009 at 9:58 AM, Gregory Maxwell <[email protected]> wrote: > On Wed, Feb 11, 2009 at 12:29 PM, Robert Rohde <[email protected]> wrote: >> Yes Domas, haha, because no one would ever want to write about math or >> high precision scientific measurements in an encyclopedia. > > Holy crud! You don't use floating point for this! If you need > deterministic behaviour and high accuracy you need to confine yourself > to integer mathematics.
Actually PHP's maxint craps out at 10 digits. That's not currently the issue though. <snip> >> Am I wrong in thinking that the server admins should care when >> different machines produce different output from the same code? In >> this case, the behavior suggests it may be as simple as ensuring that >> the servers have the same php.ini precision settings. > > Is there any reason to think that this is related to to a PHP setting > rather than being a result of differences in compiler decisions with > respect to moving variables in in off the x87 stack and into memory or > the use of SSE? Or some libc difference in how the FPU rounding mode > is set? <snip> Yes there is. Testing with various types of expressions supports the view that PHP is aware of the extra digits (out to the double limit of ~15 digits) and able to consistently perform math with them regardless of which server is processing the request. For example, if you perform operations that reduce the precision by removing the highest most digits, then the lowest digits (that had previously been hidden) will reappear. So it appears the internal representations are the same and it is merely a matter of how the information is being output. Since the number of digits to output is governed by the PHP setting that would seem to be the most likely cause. -Robert Rohde _______________________________________________ Wikitech-l mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikitech-l
