Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to obtain decimal value from .solve() ?

var('n')
f(x,n) = -x^-1 + (1.097e7)*((1/(n-1)^2) - (1/n^2))

for i in range (2,10):
    L = f(x,i).solve(x)
    print(L)

[x == (1/8227500)]

[x == (9/13712500)]

....

How can I have this display a float value for x, rather than a fraction?