Dima Pasechnik wrote:
>
> Perhaps I don't see something trivial, but how does one
> convert Expression Complex Float to Complex Float?
>
> In my case the expression is a sum of dilog()
> terms where each dilog argument is a Complex Float.
>
> Namely:
> r:=integrate(log(cos(3+x/2)),x);
> w:=eval(r,x=2) :: Expression Complex Float;
>
> and I want to find w as a complex number.
You hit a gap in functionality. Namely, original design
assumed that Expression(Complex(Float)) will compute numeric
value in cases when there is no variables. In such case
using 'retract' will produce 'Complex(Float)'. However,
such automatic evaluation is causing trouble is some
contexts, so it is not done for special functions. We
need to implement a new function to numerically evaluate
expressions.
ATM the best is probably:
(4) -> interpret(w::InputForm)
(4) - 4.5842055843_793301699 + 6.2831853071_795864769 %i
Type: Complex(Float)
but it is a hacky way...
--
Waldek Hebisch
[email protected]
--
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.