在Python中,可通过import命令导入模块以扩展功能。例如,math模块中的floor函数可去除数值的小数部分,与四舍五入的round函数不同,它直接向下取整,但结果仍保留小数形式。如floor (2.9)将返回2.0。使用时需先用import导入相应模块,语法结构为import 模块名,之后即可调用其中的函数来增强程序处理能力。
How-To Geek on MSN
The math Module in Python: 6 Common Calculations You Can Make
One useful feature of the Python math module is quick access to mathematical constants. You can make Python more effective as a scientific calculator by using these same functions with numerical ...
当前正在显示可能无法访问的结果。
隐藏无法访问的结果