Replies: 1 comment
-
Got an answer, closing the discussion: This is due to how floating-point numbers are represented in binary format in computers. The number 0.46 - 0.445 should theoretically be exactly 0.015, but due to the way floating-point numbers work in binary, some decimal numbers cannot be represented exactly. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
In Visual Studio 2022 (17.14.9) in the Interactive window, when performing the following operation:
0.46 - 0.445
dotnet is returning 0.015000000000000013, why? I'm missing something?
Beta Was this translation helpful? Give feedback.
All reactions