I have to get certain precision in my code. However, I think due to summing up of errors in long arrays, it accumulates on a bigger error. Would you identify why element 38260 is not equal to 5.6?
import numpy as np
xmin = -377
xmax = 345
spacing = 0.01
a = np.arange(xmin,xmax,spacing)
print('{0:.25f}'.format(a[38260]))
# Prints 5.5999999996520273271016777
print(a[38260] == 5.6)
# Prints false
b = np.arange(xmin/spacing,xmax/spacing)*spacing
print('{0:.25f}'.format(b[38260]))
#Prints 5.6000000000000005329070518
print(b[38260] == 5.6)
#Prints false