http://bugzilla.novell.com/show_bug.cgi?id=596339
http://bugzilla.novell.com/show_bug.cgi?id=596339#c0 Summary: Converting double.NaN to int doesn't generate OverflowException Classification: Mono Product: Mono: Runtime Version: 2.4.x Platform: x86-64 OS/Version: openSUSE 11.2 Status: NEW Severity: Normal Priority: P5 - None Component: misc AssignedTo: [email protected] ReportedBy: [email protected] QAContact: [email protected] Found By: --- Blocker: --- Converting (but not casting!) double.NaN to an int results in different behavior under Mono and .NET 3.5. Consider the following program: using System; class Test { static void Main () { IConvertible v = double.NaN; Console.WriteLine(v.ToInt32(null)); } } Under Mono, "0" is printed, while .NET gets an OverflowException. For those with `csharp`, the one-line equivalent is: Convert.ChangeType(double.NaN, typeof(int)); which likewise returns 0 under Mono and results in an OverflowException on NET. -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug. You are the assignee for the bug. _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
