From: Hans-Bernhard B. <br...@ph...> - 2005-11-10 08:04:11
|
Victor Bandur wrote: > All, > > In trying to plot a discrete signal, I get the following result. > Plotting floor(10*x) / 10 should, theoretically, yield the same plot as > floor(10*x) * 0.1, By which theory, exactly? You're missing one aspect of computer-based arithmetic here: the existence of different types of numbers. gnuplot's floor() function yields an actual integer, not a floating-point number with an integer value. So dividing it by another integer will behave differently from multiplying it with the floating-point inverse of that integer. To get the same as floor(10*x)*0.1, try floor(10*x)/10.0 > but the former yields the plot for floor(x). Only for positive arguments. > Is this intentional? Yes. |