There are some useful things that you can do with zoo like:

In [1]: 1/zoo
Out[1]: 0

If it weren't for things like this then I think exceptions would
always be better.


--
Oscar

On Wed, 23 Jun 2021 at 22:49, Aaron Meurer <asmeu...@gmail.com> wrote:
>
> Complex infinity is a mathematically meaningful object, and SymPy
> generally prefers to give mathematically meaningful results when it
> can, even if they are unevaluated. You're right that if you get zoo
> out of something it usually means you made a mistake somewhere, but it
> is also possible to use it intentionally.
>
> Although this argument could be made for something like nan, which
> isn't as mathematically meaningful. It's really just a way to say
> "undefined" and exists primarily so that we can avoid exceptions.
>
> Aaron Meurer
>
> On Tue, Jun 22, 2021 at 4:06 AM David Bailey <d...@dbailey.co.uk> wrote:
> >
> > On 21/06/2021 23:13, Aaron Meurer wrote:
> > > It's worth noting that if you used a Jupyter notebook with LaTeX
> > > output, zoo prints in a nice way (\tilde{\infty}), that makes it
> > > easier to tell what it is.
> > >
> > > The problem with printing oo and zoo in longer form is that it makes
> > > things more verbose, especially for oo, which might appear many times
> > > in an expression, if it is in the limits of integration for instance.
> > > I do think you should be able to enter them by typing out Infinity and
> > > ComplexInfinity. Presently, you can do this if you add an S, like
> > > S.Infinity, but only the shorter names are in the top-level namespace.
> > >
> > > I do agree that the name "zoo" is a little opaque (I guess it means
> > > z-oo, where oo is infinity and z means "the complex variable z"). Even
> > > oo is confusing until you realize what it is. Personally I would have
> > > just called it inf.
> > >
> > > Aaron Meurer
> > >
> > > On Sun, Jun 20, 2021 at 2:05 PM David Bailey <d...@dbailey.co.uk> wrote:
> > >> Dear group,
> > >>
> > >> I recently spent some time debugging something which was producing an
> > >> expression involving k*zoo.
> > >>
> > >> Eventually I used help on zoo and discovered it meant complex infinity!
> > >>
> > >> k/0
> > >>
> > >> gives
> > >>
> > >> k*zoo
> > >>
> > >> Wouldn't it be more helpful to spell this out as k*ComplexInfinity?
> > >> Maybe oo could be spelled out as Infinity as well?
> > >>
> > >> David
> > >>
> > >> --
> > >> You received this message because you are subscribed to the Google
> > >> Groups "sympy" group.
> > >> To unsubscribe from this group and stop receiving emails from it,
> > >> send an email to sympy+unsubscr...@googlegroups.com.
> > >> To view this discussion on the web visit
> > >> https://groups.google.com/d/msgid/sympy/ac945d13-2eb6-f073-1186-b16358e6ac4e%40dbailey.co.uk.
> >
> > Thanks for that explanation. Clearly oo is something that is routinely
> > input by users - as an integration limit, for example - but to my
> > knowledge complex infinity is far less useful. I do wonder if rather
> > than generating expressions involving zoo, it might be better to simply
> > raise an exception?
> >
> >
> > David
> >
> >
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "sympy" group.
> > To unsubscribe from this group and stop receiving emails from it, send an 
> > email to sympy+unsubscr...@googlegroups.com.
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msgid/sympy/981f28be-8571-a036-318e-a5671a18cbb6%40dbailey.co.uk.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sympy+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sympy/CAKgW%3D6LxVWYjX%3DFmW%3DbfCUtaRkWqsGPKQnTTAo4igHrh6tfd0w%40mail.gmail.com.

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAHVvXxQ68DznjJguOiR1Q6cfyc0Acn9RNz6fOwzR631UgREXLg%40mail.gmail.com.

Reply via email to