I'm trying to understand how floating point operations give different output. The tests performed below result to 1; however vb.net and c# give different output, whereas java gives a different output. It probably has to do something with compiler and I read What Every Computer Scientist Should Know About Floating-Point Arithmetic but its confusing, can someone explain in simple language?
VB.NET
Dim x As Single = 1.000001
Dim y As Single = 0.000001
Dim result = x - y
Output: 0.9999999 Click here to see output Same goes for C#
Also, while watching the variable in visual studio, the value of result is different from what it outputs, which is trimmed while printing and only seven 9's are printed(which is understood), but I dont understand how the actual result for them is 0.99999994
Update: Alright, I'm more specifically interested in how this calculation is done(removed java stuff)