Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Hi,

I have the same problem using 'pi' in Sage shell or Sage scripts : computing "vector([cos(pi), sin(pi)])" will give a numerical answer but when using "random()2pi", we have a symbolic answer like "0.2456412311*pi" and so on.

So for now I will use another variable PI=n(pi) and this will give numerical values as I want. Not a real problem, I just have to add a short affectation but maybe there is a way to specify once for all we want numerical values instead of symbolic expression. In the case I have to use more constants like pi,e, etc...

Hi,

I have the same problem using 'pi' in Sage shell or Sage scripts : computing "vector([cos(pi), sin(pi)])" will give a numerical answer but when using "random()2pi", we have a symbolic answer like "0.2456412311*pi" and so on.

So for now I will use another variable PI=n(pi) and this will give numerical values as I want. Not a real problem, I just have to add a short affectation but maybe there is a way to specify once for all we want numerical values instead of symbolic expression. In the case I have to use more constants like pi,e, etc...

bigduke

Hi,

I have the same problem using 'pi' in Sage shell or Sage scripts : computing "vector([cos(pi), sin(pi)])" will give a numerical answer but when using "random()2pi", we have a symbolic answer like "0.2456412311*pi" and so on.

So for now I will use another variable PI=n(pi) and this will give numerical values as I want. Not a real problem, I just have to add a short affectation but maybe there is a way to specify once for all we want numerical values instead of symbolic expression. In the case I have to use more constants like pi,e, etc...

edit: prefer methods to functions :

When using n(pi) and then a loop with increment n will overwrite n() function. So it's better to use pi.n() and not n(pi).

bigduke