Description
It appears that sympy currently does not adequately simplify floor integer division (i.e., Python's operator //
).
Given var = sympy.Symbol('var', integer=True)
,
sympy.simplify(var // 2 // 3)
results in floor(floor(var/2)/3)
instead of floor(var/6)
.
Mathematically we can easily prove the following equation, so can we use it to simplify the above nested floor division?
Update: There is a more general equation
Update: The ceil function has similar property.