https://bugzilla.novell.com/show_bug.cgi?id=399389
Summary: DateTime.AddMilliseconds should round to nearest integer
Product: Mono: Class Libraries
Version: SVN
Platform: All
OS/Version: All
Status: NEW
Severity: Normal
Priority: P5 - None
Component: CORLIB
AssignedTo: [email protected]
ReportedBy: [EMAIL PROTECTED]
QAContact: [email protected]
Found By: ---
Currently, our implementation of DateTime.AddMilliseconds does not round the
specified number of milliseconds to the nearest integer.
This actually matches the documentation (but not the implementation) of .NET
1.1, but MS fixed the documentation in .NET 2.0.
To reproduce, compile and run the following code:
using System;
class Program
{
static void Main ()
{
DateTime date = new DateTime (2008, 12, 7);
dt = dt.AddMilliseconds (8.888);
Console.WriteLine (dt.Ticks);
dt = dt.AddMilliseconds (-5.444);
Console.WriteLine (dt.Ticks);
}
}
Expected result:
633642048000090000
633642048000040000
Actual result:
633642048000088880
633642048000034440
--
Configure bugmail: https://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