programming-examples/python/Math/Calculate the absolute value of a floating point number.py

6 lines
118 B
Python
Raw Normal View History

2019-11-15 12:59:38 +01:00
import math
print(math.fabs(-2.1))
print(math.fabs(-0.0))
print(math.fabs(10.1))
print(math.fabs(0.0))