[Python-ideas] Float range class
Steven D'Aprano
steve at pearwood.info
Fri Jan 9 04:34:10 CET 2015
On Thu, Jan 08, 2015 at 07:20:39PM -0800, Devin Jeanpierre wrote:
[...]
> > As for where it should live, the math module is the obvious place, but
> > it is written in C (which is a barrier to adding new functionality, as
> > opposed to Python modules).
>
> I actually expect the math module to convert to float, just like I
> expect the cmath module to convert to complex. For example:
>
> # python 3.4
> >>> math.sqrt(decimal.Decimal(0))
> 0.0
>
> Are there any exceptions to this?
py> from math import factorial
py> factorial(5.0)
120
--
Steve
More information about the Python-ideas
mailing list