This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author belopolsky
Recipients belopolsky, casevh, pitrou, rhettinger, skrah
Date 2014-09-20.16:38:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1411231088.07.0.732795088443.issue22444@psf.upfronthosting.co.za>
In-reply-to
Content
> Perhaps it's worth mentioning that several people on Python-ideas
> took the opposite view:  math.floor() should return a float.

I sympathize with the idea that math module functions should return floats.  I find it unfortunate that math.floor delegates to the __floor__ dunder on non-floats instead of doing math.floor(x.__float__()).  It would be more natural to have a floor builtin that *always* delegates to __floor__ and keep math a pure float library.

Note that math module provides the means to compute C-style floor:

>>> x = float('inf')
>>> math.modf(x)[1]
inf
>>> x = -3.4
>>> math.modf(x)[1]
-3.0

Maybe we should add floorf, ceilf, etc. as well.  This, however, is a different issue from the one at hand here.
History
Date User Action Args
2014-09-20 16:38:08belopolskysetrecipients: + belopolsky, rhettinger, pitrou, casevh, skrah
2014-09-20 16:38:08belopolskysetmessageid: <1411231088.07.0.732795088443.issue22444@psf.upfronthosting.co.za>
2014-09-20 16:38:08belopolskylinkissue22444 messages
2014-09-20 16:38:07belopolskycreate