Code: Select all
>>> x=Symbol('x')
>>> (x+1)/2
x/2 + 1/2
< /code>
Eindeutig nicht das, was ich will, 1/2 < /code> ist keine Ganzzahl. < /p>
>>> (x+1)//2
TypeError: unsupported operand type(s) for //: 'Add' and 'int'
< /code>
Offensichtlich sympy < /code> handle //
Code: Select all
>>> Integer((x+1)/2)
# A long list of error messages, ending with ...
TypeError: Integer can only work with integer expressions.