Sympy (ver. 1.1.1) documentation of collect_const
says that using the Numbers=False
option, "no Float or Rational will be collected". This makes you think that rationals are normally collected by collect_const
, but they don't seem to be:
>>> from sympy import *
>>> x, y, z = symbols('x y z')
>>> collect_const(2*x - 2*y - 2*z, 2)
2*(x - y - z)
>>> collect_const(x/2 - y/2 - z/2, 1/2)
x/2 - y/2 - z/2
Am I missing something?
Thank in advance.