Make sure that operator % throws an exception when the ride-hand-side argument is 0

fixes #8089