HN2new | past | comments | ask | show | jobs | submitlogin

...and which exercised the weird feature of some x86 processors that had something like 80-bit internal registers but did 64 bit double precision computations, and which allowed the garbage in the extra bits to contaminate the LSB, resulting in very slightly different behaviour in debug and release mode, which gave me fits for weeks...

FWIW, this is a compiler error. Most x86 processors have 80-bit extended floats, which allow 64-bit "pow" to be computed in software with low error (among other benefits). Some compilers "helpfully" compile for 80-bit mode with some combinations of compile options. They should never do this unless it's specifically asked for using a single command-line option, partly for the reason you discovered: it totally messes with replicability. It also messes with implementations of "log1p", Kahan summation, and other high-precision algorithms like double-double arithmetic.

If you ever come across this again, submit a bug report.



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

Search: