This question already has an answer here:
- Is floating point math broken? 20 answers
Here is my input
import numpy as np
array = [0.29, 0.59, 0.12]
na_array = np.array(array)
a = np.sum([0.29, 0.59, 0.12])
print a
if (a == 1.0):
print "success"
the output is:
1.0
Why isn't "success" printed?
Aucun commentaire:
Enregistrer un commentaire