MCPcopy Index your code
hub / github.com/python/cpython / test_complex

Method test_complex

Lib/test/test_numeric_tower.py:108–117  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

106 self.check_equal_hash(x, F.from_float(x))
107
108 def test_complex(self):
109 # complex numbers with zero imaginary part should hash equal to
110 # the corresponding float
111
112 test_values = [0.0, -0.0, 1.0, -1.0, 0.40625, -5136.5,
113 float('inf'), float('-inf')]
114
115 for zero in -0.0, 0.0:
116 for value in test_values:
117 self.check_equal_hash(value, complex(value, zero))
118
119 def test_decimals(self):
120 # check that Decimal instances that have different representations

Callers

nothing calls this directly

Calls 1

check_equal_hashMethod · 0.95

Tested by

no test coverage detected