why sqrt is not a built-in function?
Ethan Furman
ethan at stoneleaf.us
Thu Jan 14 14:36:14 EST 2021
On 1/14/21 11:06 AM, Eli the Bearded wrote:
> "There should be one-- and preferably only one --obvious way to do it."
>
> Meanwhile, Alan Gauld pointed out:
>
> AG> because pow() is a builtin function and
> AG> root = pow(x,0.5)
> AG> is the same as
> AG> root = math.sqrt(x)
>
> Plus the ** operation ("root = x ** 0.5"), that's now three ways.
Yes, but which of those is obvious?
--
~Ethan~
More information about the Python-list
mailing list