AngouriMath

Navigation

← Back to list of members

MayBeAPolynomialWithRationalCoefficients​(AngouriMath.​Entity,​AngouriMath.​Entity.​Variable)

 Method (no overloads)

Summary

Whether expr has the shape of a polynomial in x whose coefficients could all be rational: x occurs only under
sums, products, quotients by something free of it, and whole non-negative powers,
and no subtree free of x carries a symbol or a constant. A
necessary condition, read off the tree without building anything; what passes it
is still expanded and checked.

Remarks

A symbol in a coefficient is refused outright rather than expanded and evaluated,
because a coefficient with a symbol in it is not rational, and the one way it could
still be -- the symbol cancelling against itself across terms -- is what
InnerSimplified has already collected before anything here is
asked. A constant is refused for the same reason: pi is not rational either. An
irrational literal such as sqrt(2) is not refused here, since it is a power of
a rational and reads as one; the expansion still decides it.

























Angouri © 2019-2023 · Project's repo · Site's repo · Octicons · Transparency · 4378 pages online