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

Dietmar Maurer dietmar@ximian.com
28 Feb 2002 10:44:01 +0100


fixed in CVS

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
>