[Bug 60553] New: .NET Framework 4.8 : Rounding error when casting a nullable float variable (0.001) to a decimal
http://bugs.winehq.org/show_bug.cgi?id=60553 Bug ID: 60553 Summary: .NET Framework 4.8 : Rounding error when casting a nullable float variable (0.001) to a decimal Product: Wine Version: 11.0 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@list.winehq.org Reporter: godonnell@curtisswright.com Target Milestone: --- Distribution: --- float? Step = (float)0.001; Casting Step to a decimal yields a value of 0.0010000001 Example Code: internal class Program { static void Main(string[] args) { float? Step = (float)0.001; Console.WriteLine($"Step.Value = {Step.Value}"); Console.WriteLine($"(decimal)Step = {(decimal)Step}"); double? DoubleStep = (double)0.001; Console.WriteLine($"DoubleStep.Value = {DoubleStep.Value}"); Console.WriteLine($"(decimal) DoubleStep = {(decimal)DoubleStep}"); } } Output: Windows 11 Step.Value = 0.001 (decimal)Step = 0.001 DoubleStep.Value = 0.001 (decimal) DoubleStep = 0.001 debian trixie running wine 11.0 Step.Value = 0.001 (decimal)Step = 0.0010000001 DoubleStep.Value = 0.001 (decimal) DoubleStep = 0.001 -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
participants (1)
-
WineHQ Bugzilla