We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 13cedfa commit 464eb6cCopy full SHA for 464eb6c
symengine/lib/symengine_wrapper.pyx
@@ -1722,7 +1722,7 @@ class Integer(Rational):
1722
return sage.Integer(str(self))
1723
1724
def __int__(Basic self):
1725
- return symengine.mp_get_si(deref(symengine.rcp_static_cast_Integer(self.thisptr)).as_integer_class())
+ return int(str(self))
1726
1727
@property
1728
def p(self):
symengine/tests/test_number.py
@@ -15,8 +15,10 @@ def test_integer():
15
16
17
def test_integer_long():
18
- i = Integer(123434444444444444444)
19
- assert str(i) == "123434444444444444444"
+ py_int = 123434444444444444444
+ i = Integer(py_int)
20
+ assert str(i) == str(py_int)
21
+ assert int(i) == py_int
22
23
24
def test_integer_string():
0 commit comments