Let me try that again since I mangled the last response:
Sure. And my expectation that 5 divided by 3 times 3 ought to equal 5 and not 4.9999998 is due to my relative understanding of math and relative lack of understanding regarding the inner workings of common calculators. Is there some downside to fixing rounding errors in math functions? If so, then we might as well throw up our hands that trying to delimit numbers via math functions is a lost cause.
On Feb 2, 2009, at 2:32 PM, Gregory Maxwell wrote:
On Sat, Jan 31, 2009 at 8:33 PM, Robert Rohde rarohde@gmail.com wrote:
This discussion is getting side tracked.
The real complaint here is that
{{#expr:(0.00007 * 1000 * 1000) mod 1000}} is giving 69 when it should give 70.
This is NOT a formatting issue, but rather it is bug in the #expr parser function, presumably caused by some kind of round-off error.
It's a bug in the user's understanding of floating point on computers, combined with % being (quite naturally) an operator on integers.
0.000070000… does not exist in your finite precision base-2 based computer.
I don't think it's reasonable for Mediawiki to include a full radix-n multi-precision floating point library in order to capture the expected your behavior for these cases, any more than it would be reasonable to expect it to contain a full computer algebra system so it could handle manipulations of irrationals precisely.
_______________________________________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l