Python Math Library Independent of the C Math Library and Platform Independent?

Is the Python built-in math library embedded in the C math library, or does Python have a C-independent math library? Also, an independent Python platform library?

+3
source share
2 answers

below is the page on which it is written :

Note. The module mathconsists mainly of thin wrappers around the functions of the C library math. The behavior in exceptional cases is poorly defined by the C standards, and Python inherits most of its math-function error-reporting behavior from the C platform implementation. As a result, specific exceptions that occur in cases of errors (and even if some arguments are considered exceptional at all) are not defined in what a useful cross platform or cross version. For example, whether it returns a math.log(0)value -Infor raises a value ValueErroror OverflowErrorisnt, and in cases where it math.log(0)raises OverflowError, it math.log(0L)can raise ValueError.

NaN, NaN. NaN . - libm. ValueError EDOM OverflowError errno ERANGE.

2.6: Python NaN libm.

+5

Python C, . Windows " C".. , MicrosoftCRunTimeLibrary (MSCRT).

+2

Source: https://habr.com/ru/post/1713165/


All Articles