Why .NET 5.0 and Framework in C# does not return same value

Viewed 227

I have two values like below,

V1 = 44194.291666666664 and v2 = 44193.

Below operations returns different values in .NETCore and .Framework

Product results Arithmetic operation : (v1 - v2) ToString() (v1 - v2).ToString()
.NET5.0 result 1.2916666666642413 "1.2916666666642413"
.NETFramework result 1.2916666666642414 "1.29166666666424"

Code snippet

        double v1 = 44194.291666666664;
        double v2 = 44193;

        double value = v1 - v2;
        string output = (v1 - v2).ToString();
1 Answers
Related