I think this would need significant work in both the standard library and the compiler builtins to make this fast, but the benefits would be so worth it. I’m tired of chasing down NaNs just because they propogate silently with IEEE floats. If it were integrated into Optionals (which i feel like it certainly could be with little performance impact, since test is pretty cheap and we would expect the NaN branch to almost never be taken) it would be natural to catch and handle the NaN right when it gets generated, instead of at the end of the algorithm.
2 Likes