• Home
  • Raw
  • Download

Lines Matching refs:hypot

740         hypot = math.hypot
747 hypot(*args[:i]),
752 self.assertEqual(hypot(12.0, 5.0), 13.0)
753 self.assertEqual(hypot(12, 5), 13)
754 self.assertEqual(hypot(Decimal(12), Decimal(5)), 13)
755 self.assertEqual(hypot(Fraction(12, 32), Fraction(5, 32)), Fraction(13, 32))
756 self.assertEqual(hypot(bool(1), bool(0), bool(1), bool(1)), math.sqrt(3))
759 self.assertEqual(hypot(0.0, 0.0), 0.0) # Max input is zero
760 self.assertEqual(hypot(-10.5), 10.5) # Negative input
761 self.assertEqual(hypot(), 0.0) # Negative input
763 math.copysign(1.0, hypot(-0.0)) # Convert negative zero to positive zero
766 hypot(1.5, 1.5, 0.5),
767 hypot(1.5, 0.5, 1.5),
772 hypot(x=1)
774 hypot(1.1, 'string', 2.2)
777 hypot(1, int_too_big_for_float)
780 self.assertEqual(hypot(INF), INF)
781 self.assertEqual(hypot(0, INF), INF)
782 self.assertEqual(hypot(10, INF), INF)
783 self.assertEqual(hypot(-10, INF), INF)
784 self.assertEqual(hypot(NAN, INF), INF)
785 self.assertEqual(hypot(INF, NAN), INF)
786 self.assertEqual(hypot(NINF, NAN), INF)
787 self.assertEqual(hypot(NAN, NINF), INF)
788 self.assertEqual(hypot(-INF, INF), INF)
789 self.assertEqual(hypot(-INF, -INF), INF)
790 self.assertEqual(hypot(10, -INF), INF)
793 self.assertTrue(math.isnan(hypot(NAN)))
794 self.assertTrue(math.isnan(hypot(0, NAN)))
795 self.assertTrue(math.isnan(hypot(NAN, 10)))
796 self.assertTrue(math.isnan(hypot(10, NAN)))
797 self.assertTrue(math.isnan(hypot(NAN, NAN)))
798 self.assertTrue(math.isnan(hypot(NAN)))
803 self.assertEqual(hypot(*([fourthmax]*n)), fourthmax * math.sqrt(n))
808 self.assertEqual(math.hypot(4*scale, 3*scale), 5*scale)