[Mono-list] Re: Runtime bug: rounding doubles

Martin Baulig martin@gnome.org
28 Feb 2002 13:08:54 +0100


Dietmar Maurer <dietmar@ximian.com> writes:

> fixed in CVS

Thanks !

> 
> On Wed, 2002-02-27 at 23:16, Martin Baulig wrote:
> > Hi,
> > 
> > here's a small test app:
> > 
> > ====
> > using System;
> > 
> > class MainApp {
> > 	public static void Main() {
> > 		long ticks = 631502475130080000L;
> > 		long ticksperday = 864000000000L;
> > 
> > 		double days = (double) ticks / ticksperday;
> > 		int intdays = (int) days;
> > 
> > 		Console.WriteLine (intdays);
> > 	}
> > }
> > ====
> > 
> > When run with the Microsoft runtime or with mint, this prints the correct
> > result - 730905.
> > 
> > When run with mono, it prints 730906.
> > 
> > -- 
> > Martin Baulig
> > martin@gnome.org
> > 
> 
> 
> 

-- 
Martin Baulig
martin@gnome.org