Python数学库独立于C数学库和平台独立?
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了Python数学库独立于C数学库和平台独立?,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1213字,纯文字阅读大概需要2分钟。
内容图文
![Python数学库独立于C数学库和平台独立?](/upload/InfoBanner/zyjiaocheng/741/09d36dbed2c843d28cf7eb172a0ee2be.jpg)
内置的Python数学库基本上是使用C的数学库吗?还是Python有一个独立于C的数学库?此外,Python数学库平台是独立的吗?
解决方法:
在the page it says的底部:
Note: The
math
module consists mostly of thin wrappers around the platform Cmath
library functions. Behavior in exceptional cases is loosely specified by the C standards, and Python inherits much of itsmath
-function error-reporting behavior from the platform C implementation. As a result, the specific exceptions raised in error cases (and even whether some arguments are considered to be exceptional at all) are not defined in any useful cross-platform or cross-release way. For example, whethermath.log(0)
returns-Inf
or raisesValueError
orOverflowError
isn’t defined, and in cases wheremath.log(0)
raisesOverflowError
,math.log(0L)
may raiseValueError
instead.All functions return a quiet NaN if at least one of the args is
NaN
. SignalingNaN
s raise an exception. The exception type still depends on the platform and libm implementation. It’s usuallyValueError
forEDOM
andOverflowError
forerrno ERANGE
.Changed in version 2.6: In earlier versions of Python the outcome of an operation with
NaN
as input depended on platform andlibm
implementation.
内容总结
以上是互联网集市为您收集整理的Python数学库独立于C数学库和平台独立?全部内容,希望文章能够帮你解决Python数学库独立于C数学库和平台独立?所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。