I'm having an hard time to understand what's going on behind the scene while performing VB6 double-precision number calculations.
Screenshot 1 : As you can see, I have a sum of 2 variables ("zpoint" and "zvecteur", visually shown by the IDE as 18881.132087 and -19091.737188)
- When summed using the variables, the result is -210.605101000001 (d)
- When "manually" summed outside of the variables, the result is -210.605100999997 (d2)
I don't understand why there's a difference, because as you can see on the 2nd screenshot, for a quite similar operation, the result is strictly the same
I'm aware that there's probably a difference between what's visually shown by Visual Basic and what's really stored in memory but it's a problem because I'll later perform iterative operations on those values, and final results can really be different because of that. I have to mention that difference in precision only happens on a few values. I did not found any pattern to understand what's going on.
Any help would be much appreciated :) Thank you very much !