From 8b3bb524204cc9cbcb39d1d7a7194508ada71615 Mon Sep 17 00:00:00 2001 From: Sergey B Kirpichev Date: Mon, 18 Sep 2023 16:01:54 +0300 Subject: [PATCH] * hypot: L2630 --- Lib/test/test_math.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Lib/test/test_math.py b/Lib/test/test_math.py index 51a14d574f6b0d..85da10dfd57aa2 100644 --- a/Lib/test/test_math.py +++ b/Lib/test/test_math.py @@ -808,6 +808,8 @@ def testHypot(self): # Test allowable types (those with __float__) self.assertEqual(hypot(12.0, 5.0), 13.0) self.assertEqual(hypot(12, 5), 13) + self.assertEqual(hypot(1, -1), 1.4142135623730951) + self.assertEqual(hypot(1, FloatLike(-1.)), 1.4142135623730951) self.assertEqual(hypot(Decimal(12), Decimal(5)), 13) self.assertEqual(hypot(Fraction(12, 32), Fraction(5, 32)), Fraction(13, 32)) self.assertEqual(hypot(bool(1), bool(0), bool(1), bool(1)), math.sqrt(3))