Hi!

On 2014-05-29, SiL588 . <[email protected]> wrote:
> Hi, i tried to simplify a number doing this:
>  m1.simplify()
> but the output is 
>
> AttributeError: 'sage.rings.real_mpfr.RealNumber' object has no
> attribute 'simplify'
>
>
> What does it mean?
> What did I do wrong? I declared m1 like this:
> m1 = var('m1')

In order to be able to help, we need code that actually results in the
error you mention. If one just defines m1 as a symbolic variable, then
it works (in a trivial way, of course):
  sage: m1 = var('m1')
  sage: m1.simplify()
  m1

But let me guess, based on your using the word "declare": Do you expect
that m1 will always be a symbolic variable after you did "m1=var('m1')"?
That's not how Python works. In contrast to C, there are no static types
associated with a variable.

So, is it perhaps the case that at some point you did this:
  sage: m1 = 1324.67
  sage: m1.simplify()
?
It is then no surprise to get an attribute error, because after re-defining
m1 as 1324.67 it is a real number, and real numbers have no
simplify method.

Best regards,
Simon


-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" 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/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to