  We solve an open problem proposed in the book ``Computing the continuous
discretely" written by Matthias Beck and Sinai Robins. That is, we proposed a
polynomial time algorithm for calculating Fourier-Dedekind sums. The algorithm
is simple modular Barvinok's simplicial cone decomposition. It can be easily
adapted into De Leora et. al.'s LattE package, which gives a nice
implimentation of Barvinok's polynomial time algorithm.
