question about symbolic/numerical mixing



  gioved? 19 febbraio 2009, 11:02, Martin Sch?necker:

> In your example, seems to be %pi that wants to retain its
> exact/symbolic value.  Maybe setting numer works for you:

  thanks for this info (and to Stefano too). I was not aware that numer
was also a variable.
 
> (%i1) numer;
> (%o1) false
> (%i2) tan((2*%pi)/9);
> (%o2) tan((2*%pi)/9)
> (%i3) numer: true;
> (%o3) true
> (%i4) tan((2*%pi)/9);
> (%o4) 0.83909963117728

  You example is a almost what i need, but don't work if the variable
is pre declared:
(%i1) numer;
(%o1)                                false
(%i2) x:tan((2*%pi)/9);
                                      2 %pi
(%o2)                             tan(-----)
                                        9
(%i3) numer:true;
(%o3)                                true
(%i4) x;
                                      2 %pi
(%o4)                             tan(-----)
                                        9
(%i5) display(x)$
                                        2 %pi
                                x = tan(-----)
                                          9

  It's possible to have a variable recalculated (or just displayed) in
a numerical form?

Thanks,
  Giovanni