Lines Matching refs:hypot
762 hypot = math.hypot
769 hypot(*args[:i]),
774 self.assertEqual(hypot(12.0, 5.0), 13.0)
775 self.assertEqual(hypot(12, 5), 13)
776 self.assertEqual(hypot(Decimal(12), Decimal(5)), 13)
777 self.assertEqual(hypot(Fraction(12, 32), Fraction(5, 32)), Fraction(13, 32))
778 self.assertEqual(hypot(bool(1), bool(0), bool(1), bool(1)), math.sqrt(3))
781 self.assertEqual(hypot(0.0, 0.0), 0.0) # Max input is zero
782 self.assertEqual(hypot(-10.5), 10.5) # Negative input
783 self.assertEqual(hypot(), 0.0) # Negative input
785 math.copysign(1.0, hypot(-0.0)) # Convert negative zero to positive zero
788 hypot(1.5, 1.5, 0.5),
789 hypot(1.5, 0.5, 1.5),
794 hypot(x=1)
796 hypot(1.1, 'string', 2.2)
799 hypot(1, int_too_big_for_float)
802 self.assertEqual(hypot(INF), INF)
803 self.assertEqual(hypot(0, INF), INF)
804 self.assertEqual(hypot(10, INF), INF)
805 self.assertEqual(hypot(-10, INF), INF)
806 self.assertEqual(hypot(NAN, INF), INF)
807 self.assertEqual(hypot(INF, NAN), INF)
808 self.assertEqual(hypot(NINF, NAN), INF)
809 self.assertEqual(hypot(NAN, NINF), INF)
810 self.assertEqual(hypot(-INF, INF), INF)
811 self.assertEqual(hypot(-INF, -INF), INF)
812 self.assertEqual(hypot(10, -INF), INF)
815 self.assertTrue(math.isnan(hypot(NAN)))
816 self.assertTrue(math.isnan(hypot(0, NAN)))
817 self.assertTrue(math.isnan(hypot(NAN, 10)))
818 self.assertTrue(math.isnan(hypot(10, NAN)))
819 self.assertTrue(math.isnan(hypot(NAN, NAN)))
820 self.assertTrue(math.isnan(hypot(NAN)))
825 self.assertTrue(math.isclose(hypot(*([fourthmax]*n)),
831 self.assertEqual(math.hypot(4*scale, 3*scale), 5*scale)
835 "hypot() loses accuracy on machines with double rounding")
848 hypot = math.hypot
894 self.assertEqual(hypot(x, y), z)