Lines Matching defs:sign
31 def sign(x):
112 approximately equal if they have the same sign (both positive or both
123 # This includes the case of two infinities with the same sign.
126 # This includes the case of two infinities of opposite sign, or
298 """Test that the helper function sign() works correctly."""
300 # Test that signed zeroes report their sign correctly.
301 self.assertEqual(sign(0.0), +1)
302 self.assertEqual(sign(-0.0), -1)
802 # Test sign is calculated correctly.
1280 """Check x is an infinity of the same type and sign as inf."""
1290 # Adding two infinities of the same sign also gives infinity.
1296 for sign in (+1, -1):
1297 self.do_test_inf(sign*inf)
1301 for sign in (+1, -1):
1302 self.do_test_inf(sign*inf)
1305 # Test that adding two infinities of opposite sign gives a NAN.
1311 # Test adding Decimal INFs with opposite sign returns NAN.
1318 # Test adding Decimal INFs with opposite sign raises InvalidOperation.
1391 for sign in (1, -1):
1392 inf = kind("inf")*sign
1399 # Test mean with infinities of opposite sign.