Hacker News new | more | comments | ask | show | jobs | submit login

A better fix would be to use "-mfpmath=sse" to disable x87 math - this also makes your program slightly faster, whereas -ffloat-store can make it much slower.

.. or not use an algorithm that depends on the hardware implementation of floating point math? How about just comparing the previous & current iteration values? If you're not making any progress, you're done.

You'd probably want to compare to an epsilon AND exact compare, otherwise you could oscillate between two values.

Ah, your point is correct. In my defense, I was just tried to be conservative.

Applications are open for YC Summer 2019

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact