Compare arguments expected and got, as floats, if either is a float, using a tolerance expressed in multiples of ulp(expected) or absolutely, whichever is greater. As a convenience, when neither argument is a float, and for non-finite floats, exact equality is demand
(self, name, got, expected, ulp_tol=5, abs_tol=0.0)
| 212 | class MathTests(unittest.TestCase): |
| 213 | |
| 214 | def ftest(self, name, got, expected, ulp_tol=5, abs_tol=0.0): |
| 215 | """Compare arguments expected and got, as floats, if either |
| 216 | is a float, using a tolerance expressed in multiples of |
| 217 | ulp(expected) or absolutely, whichever is greater. |
| 218 | |
| 219 | As a convenience, when neither argument is a float, and for |
| 220 | non-finite floats, exact equality is demanded. Also, nan==nan |
| 221 | in this function. |
| 222 | """ |
| 223 | failure = result_check(expected, got, ulp_tol, abs_tol) |
| 224 | if failure is not None: |
| 225 | self.fail("{}: {}".format(name, failure)) |
| 226 | |
| 227 | def testConstants(self): |
| 228 | # Ref: Abramowitz & Stegun (Dover, 1965) |
no test coverage detected