mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
SF Patch #497487 add test to compare conjugate of a complex number
This commit is contained in:
parent
fc37af85bf
commit
5a0f010c67
1 changed files with 4 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
|||
from test_support import TestFailed
|
||||
from test_support import TestFailed, vereq
|
||||
from random import random
|
||||
|
||||
# These tests ensure that complex math does the right thing; tests of
|
||||
|
@ -63,6 +63,9 @@ for i in range(100):
|
|||
if complex(0.0, 0.0):
|
||||
raise TestFailed("complex(0.0, 0.0) should be false")
|
||||
|
||||
if vereq(complex(5.3, 9.8).conjugate(), 5.3-9.8j):
|
||||
raise TestFailed("complex.conjugate() didn't work")
|
||||
|
||||
try:
|
||||
print int(5+3j)
|
||||
except TypeError:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue