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)
| 245 | class MathTests(unittest.TestCase): |
| 246 | |
| 247 | def ftest(self, name, got, expected, ulp_tol=5, abs_tol=0.0): |
| 248 | """Compare arguments expected and got, as floats, if either |
| 249 | is a float, using a tolerance expressed in multiples of |
| 250 | ulp(expected) or absolutely, whichever is greater. |
| 251 | |
| 252 | As a convenience, when neither argument is a float, and for |
| 253 | non-finite floats, exact equality is demanded. Also, nan==nan |
| 254 | in this function. |
| 255 | """ |
| 256 | failure = result_check(expected, got, ulp_tol, abs_tol) |
| 257 | if failure is not None: |
| 258 | self.fail("{}: {}".format(name, failure)) |
| 259 | |
| 260 | def testConstants(self): |
| 261 | # Ref: Abramowitz & Stegun (Dover, 1965) |
no test coverage detected