Christopher Smith
Christopher Smith
see #20479
This sub-optimal use of evalf is an attempt to deal with the object not being something that evalf knows how to evaluate. IIUC, evalf is trying to return a number...
Asking an expression to evaluate as much as possible as a number is a bad idea (e.g. `x + y - z` with `{y: yval, z: zval}` because substitution of...
I view this as wanting to define a custom canonical form in which all products are stripped of leading number Float or Rational. `mycan = lambda expr: expr.replace(lambda x: x.is_Mul,...
Sure: just modify `mycan`: ```python >>> mycan = lambda expr: expr.replace(lambda x: x.is_Mul, lambda x: x.as_coeff_Mul()[1]) >>> mycan(2*x+3) == mycan(3*x-4) True ``` I avoid `match` for the most part but...
There is a more recent algorithm for solving systems of linear diophantine equations discussed [here](https://rosettacode.org/wiki/Diophantine_linear_system_solving). Code and a reference to the online paper describing the algorithm is given there.
``` since factoring can be expensive, I think we choose not to make all powers canonical, only those that are smaller than a certain limit. From Integer._eval_power: When exponent is...
Can we write a compatibility.[int|str] function that falls back to a custom version if the size limit is exceeded?
> The CPython issue was shut down but the suggestion was to discuss this at discuss.python.org so I'll do that. Thanks for following up on this. The criticism raised there...
I searched the repo for `str(` and got 1224 hits, all in files related to tests.