OK--thank you to both of you for the advice. I think Jonathan's method is inclined towards interactive use but allows global settings. Chris's method works for my inline code methods (but wish they had global variables there!). Much appreciated Fritz
On Fri, Oct 27, 2023 at 1:58 PM Chris Smith <[email protected]> wrote: > Enter the exponent as `(S(1)/4)` or the power as `root(m*w, 4)`. > > /c > > On Thursday, October 26, 2023 at 9:16:53 PM UTC-5 [email protected] wrote: > >> In this simple string below, the result is a decimal. I have fooled a lot >> with the documentation but cannot see how to get my output as fractions >> instead of decimals. (In fact I thought a CAS would default to this). >> What is the simplest way to stop the 1-1/4 rendering to 1.25 (e.g. I want >> 5/4 here)? A global setting would be nice if one exists! >> >> Thanks >> Fritz >> >> P=(m*w)*(m*w)**(1/4) >> x = collect(P,m*w) >> print("P is: " + str(x)) >> >> P is: (m*w)**1.25 >> > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sympy/7c900e18-3cfc-4b69-93c4-dc81a76a6108n%40googlegroups.com > <https://groups.google.com/d/msgid/sympy/7c900e18-3cfc-4b69-93c4-dc81a76a6108n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CAMxgeArnSpBWD%2BQ_P_F%3DNGQzw_h4uGWTPhY6euKp--rnoxqMjQ%40mail.gmail.com.
