You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sympy
In Mul class I see this piece of code:
def _eval_is_real(self):
real = True
zero = one_neither = False
for t in self.args:
if not t.is_complex:
return t.is_complex
Don't understand last two lines. How is it possible that if t is not complex, then return that all Mul is not real?
Mateusz Paprocki
unread,
Nov 9, 2015, 5:42:51 AM11/9/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sympy
Hi,
I think this is because t.is_real implies t.is_complex, so saying
t.is_complex == False doesn't mean t.is_real == True; it means that t
is perhaps not a number (e.g. a MatrixExpr). As we employ three-valued
logic (yes, no, don't know), then returning t.is_complex is the
correct approach. Also see [1], because this code was originally wrong
(perhaps Chris can give you better explanation).