|
From: Raymond T. <toy...@gm...> - 2016-03-31 18:19:25
|
>>>>> "Richard" == Richard Fateman <fa...@be...> writes:
Richard> It is possible to construct complex numbers in lisp (though so far we have
Richard> mostly avoided it....) . The simplest way is
Richard> :lisp (setf $k #c(1 3)
Richard> now
Richard> k; prints as 3 %i+1
I wish maxima didn't do that. Well, as long as maxima doesn't really
operate with Lisp complex numbers.
Richard> however, k -3*%i -1
Richard> prints as 0 + 3 %i - 3 %i.
Richard> There are other anomalies, such as
Richard> ratcoef(k,%i) returns 0.
Richard> k+1/2 signals an error.
Richard> sin(k) signals an error
We should probably fix those. For k+1/2, the error comes from trying
to print k+1/2 which has somehow been computed as ((rat simp) #c(3 6)
2) and printing wants to compare #c(3 6) with 0.
sin(k) fails trying to apply the reflection formula and ends up
comparing (in lisp) #c(-2 -6) and 0. I have no idea where the #c(-2
-6) comes from.
--
Ray
|