Python有五个标准的数据类型:

  • 数字

    • int(整数)
    • long(长整数)
    • float(浮点实数值)
    • complex(复数)
  • 字符串

  • 列表

  • 元组

  • 字典

abs与fabs的区别

   abs是求整数的绝对值,fabs是求浮点数的绝对值

>>> type(abs(1)) 
<type 'int'>
>>> type(math.fabs(1))

>>> import math
>>> type(math.fabs(1))
<type 'float'>

 

posted on 2015-09-16 12:47  chamie  阅读(3236)  评论(0编辑  收藏  举报