| 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...
| 2 | No.2 Revision |
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
| 3 | No.3 Revision |
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
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.