Mike Sarahan wrote: > However, even linspace shows roundoff error: > > a=np.linspace(0.0,10.0,endpoint=False) > b=np.linspace(0.1,10.1,endpoint=False) > np.sum(a[1:]==b[:-1]) # Gives me 72, no 100
Are you sure equally spaced floating point numbers having this property even exist? 0.1 does not have a terminating representation in base-2: 0.1_10 = 0.0001100110011001100110011.._2 -- Pauli Virtanen _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion