Content deleted Content added
Danmichaelo (talk | contribs) |
→AssertWithinDelta: reply, and strike my mention of "assertDeltaContains" - must have been tired when I wrote that |
||
Line 19:
== AssertWithinDelta ==
The docs for <s>assertDeltaContains</s> assertWithinDelta says " While 1/3 == 9/3 evaluates as false, ...". This is an obvious result, as they are completely different numbers. I assume this was a typo for "1/3 == 3/9 evaluates as false"; however, when I tried this in the debug console just now it evaluated as true. Is there a better example we can use to demonstrate floating point error here? Personally, I haven't seen it action in Scribunto yet, so I can't think of a good one. — '''''[[User:Mr. Stradivarius|<span style="color: #194D00; font-family: Palatino, Times, serif">Mr. Stradivarius</span>]]''''' <sup>[[User talk:Mr. Stradivarius|♪ talk ♪]]</sup> 14:02, 3 January 2014 (UTC)
: True, that was a completely wrong example :) I've added a new one, and tested it in the debug console. Btw., the reason I added the method was that I ran into the problem on [[:no:Module:Coordinate/testtilfeller]]. – ''[[User:Danmichaelo|Danmichaelo]] ([[User talk:Danmichaelo|talk]])'' 00:45, 5 January 2014 (UTC)
:: Thanks for clearing that up. :) It's interesting to see how the floating point error works in a real-world example. I've given the docs a copy edit and expanded them a little to note that integers can be represented exactly up to 2^53. Feel free to tweak that if you want. — '''''[[User:Mr. Stradivarius|<span style="color: #194D00; font-family: Palatino, Times, serif">Mr. Stradivarius</span>]]''''' <sup>[[User talk:Mr. Stradivarius|♪ talk ♪]]</sup> 11:48, 5 January 2014 (UTC)
|