[Mono-bugs] [Bug 467201] New: float64 to float32 to float64 conversion bug

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sun Jan 18 11:43:34 EST 2009


           Summary: float64 to float32 to float64 conversion bug
    Classification: Mono
           Product: Mono: Runtime
           Version: unspecified
          Platform: x86
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: JIT
        AssignedTo: lupus at novell.com
        ReportedBy: kornelpal at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---

using System;
using System.Runtime.CompilerServices;

class Testing
    static double GetValue()
        return 0.19975845134874831D;

    public static void Main()
        double d = (float)GetValue();

    foreach (byte b in BitConverter.GetBytes(d))
        Console.Write (b.ToString("x2"));

Results on MS.NET:

Results on Mono:

Also see http://lists.ximian.com/pipermail/mono-list/2009-January/041075.html

It contains the original code that should be fixed as well.

I belive that the bug is exposed by my compacted test case and makes the
problem easier to analize but please ensure that the original code in the
message works as well.

Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

More information about the mono-bugs mailing list