That despite writing code for over a decade, TIL that NaN is not just a numerical equivalent of null. It’s closer to a primitive form of Maybe/Optional, in the sense that arithmetic operators are designed to output NaN should any of their inputs be NaN thereby propagating the error state in a similar fashion to monadic composition.