Ask Your Question

Revision history [back]

Why do you think that 8.9101 is wrong? It's correct rounding; more precisely, Sage does "rounding half-up", and this is correct rounding. Do not mistake it for truncation.

By the way, solving linear systems by solve() isn't the best; I'd use the linear algebra functionality, i.e.

sage: A=matrix(RDF,[[1.130, -6.990],[1.013, -6.099]])
sage: A.solve_right(vector(RDF,[14.20,14.22]))
(67.6825396825, 8.91005291005)

I've put RDF qualifiers to speed things up for Sage, so it does not have to figure out the type to use. You can use just

sage: A=matrix([[1.130, -6.990],[1.013, -6.099]])
sage: A.solve_right(vector([14.20,14.22]))

too, but this would slow Sage down if you do lots of such things with big matrices...