Displaying a smaller number of 0 for a Real call
Suppose I define the function
var('A y')
f(A,x,y)= A*x^.25*y^.25
If I call f(A,x,y)
, Sagemath returns A*x^.250000000000000*y^.250000000000000
. I suppose that is the approximation of reals by defaults. But I would like to know if I can shorten the number of 0.
For example:
The question is ; does this approximation has any consequences in subsequent operations ?
Check:
but such cosmetics can be safe only for presentation, not in calculations (where more bits of exponents can be needed). See also https://ask.sagemath.org/question/493...
Something like numpy.set_printoptions would be nice but we still have
Independent of @achrzesz's comment (which should be an answer, for the benefit of future
ask.sagemath.org
(per-)users) : do you have imperative reasons to use0.25
(inexact numerical approximation) rather than1/4
(exact rational) ?The former will coerce any future result of your function to
RR
, thus depriving you of possible simplifications using the exact value 1/4...