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

"and on my hardware it caused the splitValue to be equal to point2"

The fix is the right one, but in C/C++, hardware is not what dictates rounding mode, the language implementation does, and that can be changed at runtime (http://www.cplusplus.com/reference/cfenv/fesetround/)

I think C/C++ default to 'round to nearest', with ties doing 'round to even'. Gnu libc certainly does (http://www.gnu.org/software/libc/manual/html_node/Rounding.h...)




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

Search: