Tim Peters added the comment: [Guido] > ... We can just say that Python > won't work correctly unless your float input routine is rounding > correctly; a unittest should detect whether this is the case.
Sorry, but that's intractable. Correct rounding is a property that needs to be proved, not tested. Processors aren't fast enough to test all (roughly) 2**64 possible doubles in reasonable time, and there's only one way to get all of them right (correct rounding). There are many ways to get at least one of them wrong, and short of proof only exhaustive testing can determine whether at least one is wrong. There is no "smoking gun" specific test case, either -- different flawed routines will fail on different inputs. > I expect that more recent C runtimes for Windows are correct. Based on what? Unless MS says so somewhere, it's very hard to know. Vern Paxson and David Hough developed a test program in the early 90's, based on an excruciatingly difficult algorithm I invented for finding "hard cases", and the code they wrote still appears to be available from the places Vern mentions in this brief msg: http://www.netlib.org/fp/testbase That code doesn't guarantee to find a failing correct-rounding case if one exists, but did find failures reasonably efficiently on many platforms tested at the time. __________________________________ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1580> __________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com