Easy way to round polynomial coefficients?
y = 2.66778786276411e493t^3x - 1.93258971534823e247*x
round(y,2) or something similar is possible? To get:
y = 2.67*t^3*x - 1.93*x
y = 2.66778786276411e493t^3x - 1.93258971534823e247*x
round(y,2) or something similar is possible? To get:
y = 2.67*t^3*x - 1.93*x
Please start posting anonymously - your entry will be published after you log in or create a new account.
Asked: 2024-05-06 07:15:44 +0100
Seen: 154 times
Last updated: May 06
File imports for polynomial rings in sage
Difference Between var(), QQ() and PolynomialRing()
PolynomialRing and from __future__ import unicode_literals
Trying to display the roots of a polynomial over a finite field
Creating a polynomial ring where the variables are code generated
Exponent overflow in PolynomialRing(): need a work around
Reducing a Set of Polynomial Equations to Minimal Variables and Equations
Please see https://ask.sagemath.org/question/46059/is-it-possible-to-round-numbers-in-symbolic-expression/
var('tx, x, t') from sage.symbolic.expression_conversions import ExpressionTreeWalker
Traceback (most recent call last): File "/cocalc/lib/python3.11/site-packages/smc_sagews/sage_server.py", line 1244, in execute exec( File "", line 1, in <module> NameError: name 'SubstituteNumericalApprox' is not defined
from sage.symbolic.expression_conversions import ExpressionTreeWalker
OK. Very grateful. The outcome of that is:
The first term there means there are 493 decimal places still? It should be reduced to
e493 means 10^493. Use
show(SubstituteNumericalApprox(digits=3)(y))
to see it better.