python 浮点数取绝对值

 

import math  
  
print(math.fabs(-2.1))  
print(math.fabs(-0.0))  
print(math.fabs(10.1))  
print(math.fabs(0.0))

 

posted @ 2018-11-15 21:03  anobscureretreat  阅读(1939)  评论(0编辑  收藏  举报