From: Robert D. <rob...@gm...> - 2024-04-06 18:21:15
|
On Sat, Apr 6, 2024 at 11:03 AM Jaime Villate via Maxima-discuss <max...@li...> wrote: > Strange, > > this works for me in all the Lisp versions I have: > E(f,x,n,a,b):=block(if x=b then return(f(b)) > else > for i:1 thru n do if (x < a+i*(b-a)/n) then return(f(a+(i-1)/n)) > ); I traced E and g and I think what's happening is that 'if x = b then ... ' fails if x is a float and b is an integer, but x is equal to float(b). Then the loop runs all the way through and eventually yields 'done'. That nonnumeric value causes plot2d to complain. There have been various changes to plot2d over the last couple of years, and it seems likely OP is running a version which refuses to plot if even one value is nonnumeric. The current version just filters out nonnumeric values, which is, I think, as it should be (and has been at times in the past). FWIW Robert |