Source

hakanardo / sqrt / test_sqrt.py

Full commit
import math
from sqrt import sqrt, sqrt2, Fix16

f = Fix16(10.45)
#print int(f), float(f), float(f/2), float(f*f)

for i in range(2,10):
    print i, sqrt(i), '%4.2f' % sqrt(float(i)), \
          '%4.2f' % float(sqrt(Fix16(i))), '%4.2f' % math.sqrt(i)
    print i, sqrt2(i), '%4.2f' % sqrt2(float(i)), \
          '%4.2f' % float(sqrt2(Fix16(i))), '%4.2f' % math.sqrt(i)