![]() | 1 | initial version |
Computations in algebraic numbers are costly so
Sage computes the product of a
and b
"lazily".
Some computations force it to realise the exact value of c
.
Here are the one I would favour.
sage: c = AA(r) * AA(1/r)
sage: c
1.000000000000000?
sage: c.exactify()
sage: c
1
For the sake of completeness I also include those from @rburing's answer:
sage: c = AA(r) * AA(1/r)
sage: c
1.000000000000000?
sage: c.radical_expression()
1
sage: c = AA(r) * AA(1/r)
sage: c
1.000000000000000?
sage: c.minpoly()
x - 1
sage: c
1