Singleton Infinity vs Float Infinity

44 views
Skip to first unread message

Kevin Ventullo

unread,
Feb 1, 2015, 10:36:45 PM2/1/15
to sy...@googlegroups.com
Hi,

I posted about this on GitHub but haven't gotten much of a response. Right now there are two seemingly mathematically equivalent notions of positive and negative infinity on the real line: 

-The singleton sympy.core.numbers.Infinity, also known as "oo"
-Float("inf"), also known as "+inf"

When trying to compare one of these to the other, we get inconsistent results, e.g.

-oo < -inf

will be left unevaluated but

-inf > -oo

returns False.

I guess both of these should be False. However, we also have

oo == x is False, but
x == oo is True.

Which of these is correct? Both of them?

Kevin Ventullo

unread,
Feb 4, 2015, 11:39:28 AM2/4/15
to sy...@googlegroups.com
By the way, this is not just an intellectual curiosity: right now if you ask Sympy what is the probability a uniform random variable on [0,1] (defined with Uniform) is less than 0.5, you get an error which boils down to these comparisons. See https://github.com/sympy/sympy/issues/8910

Aaron Meurer

unread,
Feb 4, 2015, 12:56:46 PM2/4/15
to sy...@googlegroups.com
This has been brought up before. See https://github.com/sympy/sympy/issues/7765 and https://github.com/sympy/sympy/issues/8451.  I don't remember if there was ever a good reason to keep Float('inf') as a separate object from oo.

Aaron Meurer

--
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+un...@googlegroups.com.
To post to this group, send email to sy...@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/6e068b72-4c52-4b96-b01e-2a7c1bcbbe7e%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages