Not SymPy, but the Uncertainties (Python module) does what you want if you use "print(x)", where x is a ufloat number (with uncertainties).
https://pythonhosted.org/uncertainties/user_guide.html#printing


Em 17/11/2022 10:30, gu...@uwosh.edu escreveu:
An alternative interpretation of your question is that you are asking if sympy is aware of the rules for propagating significant digits through calculations? The answer is no. You have to apply the rules yourself to decide appropriate rounding.

Additional alternatives:  1) set up interval arithmetic to get a more precise version of the significant figures rules; 2) do full error propagation to determine uncertainties in your computations.

Jonathan

On Thursday, November 17, 2022 at 4:04:20 AM UTC-6 Oscar wrote:

    The ordinary Python round function can do this:
    https://docs.python.org/3/library/functions.html#round


    On Thu, 17 Nov 2022 at 09:46, Peter Stahlecker
    <peter.st...@gmail.com> wrote:

        you might want to check floating point numbers in the sympy
        documentation.

        Am Do., 17. Nov. 2022 um 10:18 Uhr schrieb 'XR-7 RKE' via
        sympy <sy...@googlegroups.com>:

            Hey guys,

            Does sympy support round a number to significant figures?

            SCR-20221117-m64.png


--
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 sympy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/16679bb6-ec43-bdd6-3a57-24542b542089%40gmail.com.

Reply via email to