NaN Propagation
NaN propagation is a pesky issue where once a floating point variable encounters some sort of operation that results in “not a number”, that variable is now always NaN. A common reason for this is dividing 0.f by 0.f. Any further operations on it will have no effect. It’s just stuck.
You’ll try to use some floating point value and discover it’s NaN, but have no idea when it became that way. It was “poisoned” earlier in execution, but there is no history or tracking to work backwards from.
You have a few options to figure it out. Some environments have an exception that will be thrown right when it happens, which is very handy. If you can’t use that, you can work backwards through the code paths and add asserts along the way. It’s often due to bad data being read in, so check the deserialization code first.