Ask Your Question

Revision history [back]

To complement @Juanjo's answer, another option is to work in the field of algebraic numbers.

sage: a = QQbar(-1/16*sqrt(6)*sqrt(3)*sqrt(2) + 1/16*I*sqrt(6)*sqrt(2) - 1/8*I*sqrt(3) + 3/8)
sage: a
0.?e-18 + 0.?e-19*I

Initially the numerical approximation for this algebraic number is only given to a certain precision.

However algebraic numbers have an exactify method, which can turn them into a simpler form.

sage: a.exactify()
sage: a
0

Here we know that a is exactly zero.