One of the first functions I define in a new environment/language is div(int m, int n) that returns 0 if n is 0.
Maths apart, is what you want almost always IRL - if you have 0 pages visited out of 0 pages, 0% will do. It saves me from tracking an exception, hamming result that is not an integer and handling the case when printing it. in practice it’s good enough.