[Mono-list] Runtime bug: rounding doubles

Martin Baulig martin@gnome.org
27 Feb 2002 23:16:18 +0100


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