Skip to content

Commit 30b120a

Browse files
Added a doctest
Added the doctest for _element_constructor_() function of AlgebraicField class.
1 parent dbb3cbe commit 30b120a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/sage/rings/qqbar.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1646,6 +1646,16 @@ def _element_constructor_(self, x):
16461646
True
16471647
sage: pi in QQbar # needs sage.symbolic
16481648
False
1649+
1650+
TESTS::
1651+
1652+
Check if :trac:`12745` is fixed::
1653+
1654+
sage: x = exp(2*I*pi/7) + exp(-2*I*pi/7)
1655+
sage: QQbar(x) in AA
1656+
True
1657+
sage: AA(x)
1658+
1.246979603717467?
16491659
"""
16501660
if isinstance(x, AlgebraicNumber):
16511661
return x

0 commit comments

Comments
 (0)