[Python-ideas] Make `float('inf') //1 == float('inf')`

Ram Rachum ram.rachum at gmail.com
Wed Sep 17 18:42:51 CEST 2014


Please see this discussion on python-list:

https://groups.google.com/forum/#!topic/comp.lang.python/maDZoc-n4bA

Currently `float('inf') //1` is equal to NaN. I think that this is really 
weird. If I understand correctly it's to maintain the invariant `div*y + 
mod == x`. The question is, do we really care more about maintaining this 
invariant rather than providing a mathematically reasonable value for floor 
division?


Thanks,
Ram.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20140917/130d2f63/attachment.html>


More information about the Python-ideas mailing list