Reputation: 210
I believe that the following should evaluate to 1, but it doesn't. Any hints on how to make it work?
n = Symbol('n')
with assuming(Q.integer(n)):
print(cos(2*pi*n))
Upvotes: 2
Views: 695
Reputation: 1143
>>> from sympy import *
>>> n = Symbol('n', integer=True)
>>> cos(2*pi*n)
1
>>> sin(2*pi*n)
0
Upvotes: 2