ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 26 Mar 2017 00:33:58 +0100formatting fractions involving square rootshttps://ask.sagemath.org/question/32383/formatting-fractions-involving-square-roots/How can I tell sage that I want the result to be shown as $\frac{1}{\sqrt{3}}$ rather than $\frac13\sqrt3$ when I type <code>show(1/sqrt(3))</code>?Sat, 30 Jan 2016 13:48:36 +0100https://ask.sagemath.org/question/32383/formatting-fractions-involving-square-roots/Comment by ndomes for <p>How can I tell sage that I want the result to be shown as $\frac{1}{\sqrt{3}}$ rather than $\frac13\sqrt3$ when I type <code>show(1/sqrt(3))</code>?</p>
https://ask.sagemath.org/question/32383/formatting-fractions-involving-square-roots/?comment=37009#post-id-37009Not really convenient but it gives the expected answer: `show(sqrt(3).power(-1,hold=True))` .Mon, 20 Mar 2017 18:26:54 +0100https://ask.sagemath.org/question/32383/formatting-fractions-involving-square-roots/?comment=37009#post-id-37009Comment by Björn for <p>How can I tell sage that I want the result to be shown as $\frac{1}{\sqrt{3}}$ rather than $\frac13\sqrt3$ when I type <code>show(1/sqrt(3))</code>?</p>
https://ask.sagemath.org/question/32383/formatting-fractions-involving-square-roots/?comment=37071#post-id-37071Thanks, that is at least something. While playing with this, I noticed that `power?` and `power??` documentation does not mention the `hold` keyword at all.
Searching for hold=True I just found https://ask.sagemath.org/question/7577/prevent-sage-from-simplifying/, which makes this question a duplicate.Sat, 25 Mar 2017 01:08:34 +0100https://ask.sagemath.org/question/32383/formatting-fractions-involving-square-roots/?comment=37071#post-id-37071Comment by ndomes for <p>How can I tell sage that I want the result to be shown as $\frac{1}{\sqrt{3}}$ rather than $\frac13\sqrt3$ when I type <code>show(1/sqrt(3))</code>?</p>
https://ask.sagemath.org/question/32383/formatting-fractions-involving-square-roots/?comment=37088#post-id-37088You have to look for `power` as a method of an expression, for example: `x.power?` or `pi.power??`Sun, 26 Mar 2017 00:33:58 +0100https://ask.sagemath.org/question/32383/formatting-fractions-involving-square-roots/?comment=37088#post-id-37088