fix: return infinity for hypot overflow#141
Conversation
Rinzii
left a comment
There was a problem hiding this comment.
Hello!
I firstly want to thank you for taking the time to contribute to CCMath. Your work is greatly appreciated!
Currently, GH has made a change to there windows runners that the main has not yet addressed but the dev branch does. Could you update this PR to follow the dev branch instead of the main branch? (I plan to have these issues with the main addressed in the current major PR I am working on for v0.3.0 but I am not yet ready for this)
Ok I actually committed my PR to the main branch as I am planning to get rid of the dev branch currently. So now all I need is for you to resolve all merge conflicts and I can properly review your code. ^^ |
Summary
Fix overflow handling in
hypot.Previously, when the true result exceeded the maximum
representable floating-point value, the implementation
returned the largest finite value instead of
+inf.This change adds an overflow check and returns
+infto match the behavior of
std::hypot. A regressiontest for the overflow boundary case has also been added.
Closes #137