Python's Numpy dot function returning incorrect value, why?

Real simple, my code is: import numpy as np a = np.array([0.4, 0.3]) b = np.array([-0.15, 0.2]) print(np.dot(a,b)) The dot product of this should be 0, and instead i get: 3.3306690738754695e-18 >Solution : For something like that i’d suggest just using the rounding function to however many decimals you got, or using this: dotproduct=0 for… Read More Python's Numpy dot function returning incorrect value, why?