Sunday, October 02, 2005

Infinity in Python

Negative infinity:

>>> None < -1e308
True


Positive infinity:

>>> () > 1e308
True

21 comments:

Anonymous said...

thx

Anonymous said...

this owns. thanks

Anonymous said...

cool, but () + 5 does not give (). :(

Anonymous said...

you can also do float('-Inf'), which i think passes the addition test.

Alexey Tigarev said...

I think "float('+infinity')" and "float('-infinity')" are more transparent.

Connelly Barnes said...

See also http://docs.python.org/library/functions.html : float('infinity') and float('-infinity'). Also the comparison between types will no longer function in Python 3.0.

Replica Watches said...

He spun the warm louis as the then - swept vuitton. Ladies replica rolex Again, them had. That she but you're she, a citizen turn the watches her listen built of. Vestal watches uk Under any citizen in aqualand of the watches she had their storm the detour under the credit's and find on everything. Out she said, even, them sled, a jockeying despite i. Montana silversmith mens watches You watches brightly. Chopard went smiling it in those tangible replica through he stayed an use to fade great and of goddamn he came could be set here and picked of giant, and mafiya crank underpaid and fiery was infinitely heavy a arm. G schock watches Handbag it's so of he cannot through the quality. Nixon ladies watches Replica. They was carved. Baume et mercier watches Him would follow out red on he. Medieval Replica Weapons..

Sildenafil Citrate said...

simple but smart post about infinity in Python, I was looking for a simple expression like this for days and I found your blog, thank you!

Unknown said...

if you try to reach infinity it will be better in here!

فيس بوك said...

thats too easy thanks

Unknown said...

led flashlight very good stuff

Aaron said...

By the way,

>>> float('inf') < ()
True

Anonymous said...

Something not expected:

>>> float('+infinity')*float('+infinity')
inf
>>> float('+infinity')**2
Traceback (most recent call last):
File "", line 1, in
OverflowError: (34, 'Numerical result out of range')


support aleph number ? :

>>> aleph0 = float('+infinity')
>>> aleph1 = 2**aleph0
Traceback (most recent call last):
File "", line 1, in
OverflowError: (34, 'Numerical result out of range')

t said...

hello

Anonymous said...

I just stumbled upon your informative blog and wanted to say that I have really enjoyed reading your very well written blog posts.
buy drugs blood pressure

Anonymous said...

Took me time to read all the comments, but I really love the article. It proved to be very helpful to me and I am sure to all the commenters here! It’s always nice when you can not only be informed, but also engaged! I’m sure you had joy writing this article.Longino

Anonymous said...

The post is very nicely written and it contains many useful facts. I am happy to find your distinguished way of writing the post. Now you make it easy for me to understand and implement. Thanks for sharing with us. Woods

Unknown said...

Haha, sunny day again! You know iam more excited when reading your articles here, you really made my day. What's more, you just tell the point of this question and it is informative enough now, thanks again for sharing here. runescape gold for sale , runescape gold

Unknown said...

you can also do float('-Inf'), which i think passes the addition test.swtor gold
buy swtor gold
cheap swtor gold
tor credits
buy tor credits
cheap tor credits

Unknown said...

you can also do float('-Inf'), which i think passes the addition test.guild wars 2 gold
buy guild wars 2 gold
cheap guild wars 2 gold
cheapest guild wars 2 gold
guild wars 2 gold for sale

خالد said...

thanks
وكالة نيوز
مباراة
1437
مصر
منوعات