On Wednesday, 3 May 2023 at 08:21:39 UTC-7 G. M.-S. wrote:
Related to a recent discussion, is there a (simple) way to find whether an expression contains non exact explicit numbers? For symbolic expression you should probably walk the entire expression tree. For sage objects, examining the parents involved should do the trick: sage: QQ.is_exact() True sage: RR.is_exact() False However, be careful: sage: A=matrix(RR,2,2,[1,2,3,4]) sage: parent(A).is_exact() True because matrix rings presently aren't aware of inexactness of their base rings. So you should walk the construction of a parent and see if there are any inexact constituents: sage: parent(A).construction() (MatrixFunctor, Real Field with 53 bits of precision) -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/05ec01f7-eef6-44a9-8c25-668821efa8b7n%40googlegroups.com.