I have a strange problem with the Mod-function when used for transforming any angle \[Omega] into the half-open interval [-\[Pi], \[Pi]). This is done by Mod[\[Omega], 2 \[Pi], -\[Pi]]:
Sorry, I had a minor error within my code. The correction must read: \text{If}[\omega \neq 0\land \omega =\pi Floor[ N[\omega/\pi] ] ,-\pi ,\text{Mod}[\omega ,2 \pi ,-\pi]]
I had forgotten the case \omega =0.
For details, see the attached slightly changed notebook “220109b Transforming an Angle.nb”.