Skip to content

Commit 903cc61

Browse files
committed
Define is_complex for PyNumber
1 parent c7ee65d commit 903cc61

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

symengine/lib/pywrapper.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ bool PyNumber::is_negative() const {
6363
bool PyNumber::is_positive() const {
6464
return PyObject_RichCompareBool(pyobject_, pymodule_->get_zero(), Py_GT) == 1;
6565
}
66+
//! \return true if complex
67+
bool PyNumber::is_complex() const {
68+
return false;
69+
}
6670

6771
//! Addition
6872
RCP<const Number> PyNumber::add(const Number &other) const {

symengine/lib/symengine/pywrapper.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ class PyNumber : public NumberWrapper {
8080
virtual bool is_negative() const;
8181
//! \return true if positive
8282
virtual bool is_positive() const;
83+
//! \return true if complex
84+
virtual bool is_complex() const;
8385
//! return true if the number is an exact representation
8486
// false if the number is an approximation
8587
virtual bool is_exact() const { return true; };

0 commit comments

Comments
 (0)