why sqrt is not a built-in function?

Michael F. Stemper mstemper at gmail.com
Fri Jan 15 14:16:02 EST 2021


On 14/01/2021 13.00, Rob Cliffe wrote:
> On 14/01/2021 17:44, Denys Contant wrote:

>> I don't understand why sqrt is not a built-in function.
>> Why do we have to first import the function from the math module?
>> I use it ALL THE TIME!
> I agree that, especially if you have experience in other languages, this 
> feels odd, and I have some sympathy for you.

I cut my teeth on FORTRAN, which has SQRT() as part of the
language. At least 3, 4, and 5 did; I never used later versions.

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".



-- 
Michael F. Stemper
This email is to be read by its intended recipient only. Any other party
reading is required by the EULA to send me $500.00.


More information about the Python-list mailing list