fpm icon indicating copy to clipboard operation
fpm copied to clipboard

Signed lowest value may cause stack overflow

Open UFOylzj opened this issue 3 years ago • 2 comments

For example, in the atan function, if x is signed and x is the lowest value, -x will be equal to x. So the function will keep calling itself and cause a stack overflow.

UFOylzj avatar Feb 10 '22 03:02 UFOylzj

Maybe a mere comparison in the method would do?

vladipus avatar Apr 05 '23 20:04 vladipus

Or possibly swap the function to be implemented for x<=0, as then there would be no attempt to negate that value.

SirNate0 avatar Dec 29 '23 02:12 SirNate0