programming-examples/python/Math/Split fractional and integer parts of a floating point number.py
2019-11-15 12:59:38 +01:00

4 lines
129 B
Python

import math
print(' (F) (I)')
for i in range(6):
print('{}/2 = {} {}'.format(i, i/2, math.modf(i/2.0)))