MCPcopy Index your code
hub / github.com/RustPython/RustPython / ftest

Method ftest

Lib/test/test_math.py:247–258  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

245class 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)

Callers 15

testConstantsMethod · 0.95
testAcosMethod · 0.95
testAcoshMethod · 0.95
testAsinMethod · 0.95
testAsinhMethod · 0.95
testAtanMethod · 0.95
testAtanhMethod · 0.95
testAtan2Method · 0.95
testCbrtMethod · 0.95
testCosMethod · 0.95
testCoshMethod · 0.95
testDegreesMethod · 0.95

Calls 3

result_checkFunction · 0.85
failMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected