fix bug in linspace due to float comparison.