Comment #11 on issue 2260 by [email protected]: (x**x).subs(x, 0) should be
nan like (1/x).subs(x, 0) is nan
http://code.google.com/p/sympy/issues/detail?id=2260
About, 1/0
I think that it is related with assumptions, my logic:
Usually the reasons of `1/0 = zoo` are:
A. We assume that symbols by default have assumption to might be complex.
B. Therefore result of expressions with symbols or result functions can be
extended to the complex plane by default too.
C. S.Zero.is_complex==True
Formally, the only [C] really yield 1/0 to be 'zoo' straightaway, and with
current assumption mechanism, there is no question about 1/0 to be zoo:
>>> S.Zero.is_complex
True
>>>
S(1)/S.Zero
>>> zoo
Regarding the [A], this basis is not quite right and not related with the
issue 1/0==zoo:
>>> x.is_complex
None
That is, `is_complex` assumption is undefined (one might say, that it is
symbolic variable too).
And regarding the [B], it is not quite right basis. [B] is corollary from
the only [C], at least implemented now in that way.
But at the same time [C] has a big problem itself:
I can't find a way to define S.Zero not to be complex:
>>> S.Zero.is_complex = False
AttributeError: 'Zero' object attribute 'is_complex' is read-only
(If this way exists, tell me please)
If I could to do it with S.Zero (and with the S.One), then I must to obtain
S.One/S.Zero = oo, not zoo.
Is it logical?
What I have wanted by this attempt:
I want transparent mechanism (assumption) to define in what filed I
operate. (especially when source values are natural numbers, and result can
be extended to some various planes):
If I operate in complex filed, then 1/0 == zoo, if I operate in real then
1/0 == oo, if I operate in split-complex field then 1/0==soo.
And of course, handling of S.Zero.is_complex and of all other Numbers is
bad way too.
We will precisely obtain the right way to determine what is 1/0 equal to,
as soon as we will solve the problem with assumption of field.
I am afraid that the global assumption must be present, saying, offhand:
>>> FieldAssumption.set("is_complex", True)
>>> S.Zero.is_complex
True
>>> S(1).is_complex
True
>>> S(1).is_real
True
>>> S(1)/0
zoo
>>> FieldAssumption.set("is_complex", False)
>>> S.Zero.is_complex
False
>>> S(1)/0
oo
--
You received this message because you are subscribed to the Google Groups
"sympy-issues" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sympy-issues?hl=en.