python标准库介绍——6 math模块详解

==math 模块==


``math`` 模块实现了许多对浮点数的数学运算函数. 这些函数一般是对平台 C 
库中同名函数的简单封装, 所以一般情况下, 不同平台下计算的结果可能稍微地有所不同, 
有时候甚至有很大出入. [Example 1-60 #eg-1-60] 展示了如何使用 ``math`` 模块.

====Example 1-60. 使用 math 模块====[eg-1-60]

```
File: math-example-1.py

import math

print "e", "=>", math.e
print "pi", "=>", math.pi
print "hypot", "=>", math.hypot(3.0, 4.0)

# and many others...

*B*e => 2.71828182846
pi => 3.14159265359
hypot => 5.0*b*