In article <463F4CD1.9030409 at ericsson.com>,
Raymond Toy <raymond.toy at ericsson.com> wrote:
> Rainer Joswig wrote:
> > In article <463BC69B.50901 at gmail.com>,
> >>
> >> Try float(atan(2/5-%i/5)).
> >>
> >> The reason I'm asking is that acot(x) is evaluated via atan(1/x). If
> >> atan(1/x) returns nil, a domain error is signaled.
> >>
> >> Ray
> >
> >
> > (%i1) float(atan(2/5-%i/5));
> >
> > (%o1) - 1.0 (.1732867951399863 %i - .3926990816987241)
> >
>
> Hmm.
>
> Ok. Can you try the original problem again, but this time, trace
> cl:atan? (Something like ":lisp (trace cl:atan)").
>
> Ray
Thanks for your help.
I think it is a bug in the Lispworks compiler.
(defun t2 (x)
(atan x))
(defun test2 ()
(t2 #C(0.4 -0.2)))
(defun test3 ()
(atan #C(0.4 -0.2)))
(test2) triggers the error.
In SYSTEM::COERCE-TO-DOUBLE-FLOAT of (#C(0.4 -0.2)) arguments should be of type REAL.
Error: In SYSTEM::COERCE-TO-DOUBLE-FLOAT of (#C(0.4 -0.2)) arguments should be of type REAL.
1 (continue) Return a value to use.
2 Supply a new argument.
3 (abort) Return to level 0.
4 Return to top loop level 0.
I'll write a bug report to Lispworks...
--
http://lispm.dyndns.org