I always thought of NaN as more of the concept of not-a-number the way that infinity in math is not a specific value but the concept of some unbounded largest possible value.
Therefore, trying to do math with either (for example: NaN/NaN or inf./inf.) was to try to pin them down to something tangible and no longer conceptual — therefore disallowed.
You can use some form of real extensions, e.g. the extended real line (+inf, -inf is often useful for programmers) or the projectively extended real line (+inf = -inf).
This is not about infinity in math not being a _specific_ value, it can certainly be (the actual infinite instead of potential).
It's simply about design and foresight, in my humble opinion.