This is a bug and it seems to have been addressed for a future release. Suffice it to say that this type of function, with infinitely many discontinuities in every neighborhood of the point being approached, is tricky to get right.
It seems that Mathematica's Limit function will give the correct answer in non-pathological situations.
so you're saying the limit doesn't exist because the function is is discontinuous?
How are you defining "Limit" ?