Will stand by for solution.
deleted my last comment. will just retype new stance now.
my point about truncating a double back to an int will always result in the same number is correct.
however, presstab is also correct that two systems can disagree over the math. It is the original int that causes the trouble. The conversion from int to double may result in the compiler rounding the int to another value if it thinks it is needed before converting it into a double. The closer you are to zero the less likely this int rounding is going to occur (that rule doesnt apply to values between 0 and 1 or between -1 and 0).
i did not know that the compiler would ever round the int off.
i found the answer here: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4296.pdf
will adjust code accordingly.
thanks for pointing this out. i need to go change something else i coded recently now too XD
NOTE: always feel free to make a commit and request a merge if you see something that should be changed