But...
sage: eq = sqrt((pi-5)^2)
sage: eq.canonicalize_radical()
pi - 5
And as you can read from the documentation
"""
Choose a canonical branch of the given expression. The square root,
cube root, natural log, etc. functions are multi-valued. The
"canonicalize_radical()" method will choose *one* of these values
based on a heuristic.
"""
As Simon said, be careful if you start using canonicalize_radical
since it does not preserve equality
sage: eq = sqrt((pi-5)^2)
sage: eq.numerical_approx()
1.85840734641021
sage: eq.canonicalize_radical().numerical_approx()
-1.85840734641021
Vincent
2015-02-27 14:36 UTC+01:00, Simon King <
simon...@uni-jena.de>:
> --
> 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
sage-support...@googlegroups.com.
> To post to this group, send email to
sage-s...@googlegroups.com.
> Visit this group at
http://groups.google.com/group/sage-support.
> For more options, visit
https://groups.google.com/d/optout.
>