why sqrt is not a built-in function?

Chris Angelico rosuav at gmail.com
Fri Jan 15 15:02:39 EST 2021


On Sat, Jan 16, 2021 at 6:21 AM Michael F. Stemper <mstemper at gmail.com> wrote:
> Here's the status of the square root function in various languages,
> in the order that I encountered them:
>
> FORTRAN    Part of the language
> Pascal     Part of the language
> SNOBOL     Part of the language
> c          Need to #include <math.h>
> clisp      Part of the language
> EcmaScript Part of the language
> python     Need to import from math
> Java       Need to import from java.math
>
> The four that appear to be in the most use currently are c,
> EcmaScript, python, and Java. Of these, only EcmaScript has
> Math.sqrt() as part of the language, and that could be partly
> due to the fact that the language doesn't have any concept of
> "import" or "include".
>

Cool. Now tell me: Of all the languages that have a built-in global
name SQRT (which does not include ECMAScript, and for the record, ES
does have imports), how many of them have a built-in or syntax for
dictionaries/mappings? I would put it to you that the ability to look
up something by name in a tree, hashtable, or equivalent, is *at
least* as useful as the ability to calculate a square root. Python
gives you both (since you can raise something to the 0.5th power),
JavaScript in a web browser gives you both, C gives you neither (you
have to #include), and you can fill in the rest yourself.

Languages differ. I don't see why it's so important to focus on just
one thing - and to complain that, even though it's in the standard
library, you have to use an import command to get it.

ChrisA


More information about the Python-list mailing list