On Mar. 17, 2013, you wrote
>> So far, based on the responses from you and Richard Fateman, it appears
>> that I will have to convert the list elements to strings and work with
>> strings to detect an overflow return from adaptive-plot.
>>
>> Ted Woollett
>>
>>
>Is adaptive-plot a C program?
>If it is a lisp program returning a list of numbers, I see no reason to
>convert the number-like things into strings.
adaptive-plot is a lisp function defined in plot.lisp, line 977 ff.
It is called by draw2d, whose definition begins on line 1010
of plot.lisp.
My problem with the behavior of adaptive-plot is that for
well behaved functions a lisp list is returned which is a
list of floating point numbers, but if the function causes
floating point overflow inside adaptive-plot, the returned
list has floating point numbers alternating with
list elements which are entirely unreadable by any function
so far, (here using gcl and with some debug printouts):
(%i1) load("singular.lisp");
(%o1) "c:/work2/singular.lisp"
(%i2) singular(exp(x^3),[x,100,1000]);
The value of NN is 1
in singular1, back from adaptive-plot
result = (100.0 #<1.#INF00e+000> 100.24245689655172 #<1.#INF00e+000>
100.48491379310344 #<1.#INF00e+000> 100.72737068965517
#<1.#INF00e+000> 100.96982758620689 #<1.#INF00e+000>
101.21228448275862 #<1.#INF00e+000> 101.45474137931035 .......
Ray has emphasized that the overflow elements are, by design, unreadable.
Hence I see no way to convert those alternate elements into lisp strings.
----------------------
By the way, what is going on with Maxima's string function when you
try to use it in lisp:
(%i1) string(abc);
(%o1) "abc"
(%i2) :lisp ($string 'abc)
Maxima encountered a Lisp error:
Error in PROGN [or a callee]: The function $STRING is undefined.
----------------------------------------------------------
Ted