> On 14 March 2011 16:40, Julien PUYDT <julien.pu...@laposte.net> wrote: > > Le 14/03/2011 14:12, David Kirkby a écrit : > > > > The solution of finding a "good" integer is fragile : it will break > > anytime wind will change direction. > > I tend to agree. > > > Actually, the best solution is the one I gave : handle fuzzy results! You > > have to keep in mind that floats can't seriously be used for equality -- > > there is a margin of error (and the margin moves according to the > > floating comma which gave its name to the type). > > > > Are doctests pure string checks? Can't they allow things like "(result - > > expected) < 0.0000001" ? > > The "doc" in the doctest indicates a test of the documentation. The > Sage documentation has numerous examples. The doctests check that > those examples produce the same strings as the documentation > indicates, which is what you see here. > > The usual approach in Sage for these "numerical noise" issues as > people here call them, is to test only a certain number of the digits. > > So whilst you can make a test like you say, It would not test the > documentation in the same way as is intended in this test. > > There probably is a better solution than what I know, but I've only > ever seen these issues resolved this way. > Actually rather than putting ellipses we could ask for the result with a given number of significant with say .n(5) or something. That would take care of problems like 119.9999 and so on.
Francois This email may be confidential and subject to legal privilege, it may not reflect the views of the University of Canterbury, and it is not guaranteed to be virus free. If you are not an intended recipient, please notify the sender immediately and erase all copies of the message and any attachments. Please refer to http://www.canterbury.ac.nz/emaildisclaimer for more information. -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org