[Mono-list] -- Math.cs --

Reggie Burnett rykr@bellsouth.net
Thu, 6 Feb 2003 07:11:39 -0600


This is apparently called Bankers Rounding.  Here is a link talking
about it from Borland

http://bdn.borland.com/article/0,1410,15625,00.html



> -----Original Message-----
> From: mono-list-admin@lists.ximian.com [mailto:mono-list-
> admin@lists.ximian.com] On Behalf Of dietmar
> Sent: Thursday, February 06, 2003 4:54 AM
> To: yoros@wanadoo.es
> Cc: mono-list
> Subject: Re: [Mono-list] -- Math.cs --
>=20
> Marcus just pointed out the we cant use round(), because it does not
> conform to IEEE rounding conventions. Try the following test:
>=20
> using System;
>=20
> class Test {
>=20
> 	static void Main () {
> 		Console.WriteLine (Math.Round((double)2.5));
> 		Console.WriteLine (Math.Round((double)3.5));
> 		Console.WriteLine (Math.Round((double)4.5));
> 		Console.WriteLine (Math.Round((double)5.5));
> 	}
> }
>=20
> Result is:
>=20
> 2
> 4
> 4
> 6
>=20
> - Dietmar
>=20
> On Sun, 2003-02-02 at 09:42, yoros@wanadoo.es wrote:
> > Hi,
> >
> > Here are the final files that I got. I think that the Math
performance
> > is good and that the results are the most accurate that can be with
> > "libm" because MS.NET are using another kind of numerical
algorithms.
> >
> > I changed the following files:
> >
> >         mcs/class/corlib/System/Math.cs
> >         mono/mono/metadata/icall.c
> >         mono/mono/metadata/sysmath.h
> >         mono/mono/metadata/sysmath.c
> >
> > With this mail, there is the changelog file for Math.cs (please, be
> > careful with the "tildes").
> >
> > Sorry for the other posts, I was trying to get this out quickly
> > because
> > I have a lot of work and I must study.
> >
> > See you,
> >
> >     Pedro
> >
> > --
> > Pedro Martinez Juli=E1
> > \  yoros@terra.es
> > )|    yoros@wanadoo.es
> > /        http://yoros.cjb.net
> > Socio HispaLinux #311
> > Usuario Linux #275438 - http://counter.li.org
> > GnuPG public information:  pub  1024D/74F1D3AC
> > Key fingerprint =3D 8431 7B47 D2B4 5A46 5F8E  534F 588B E285 74F1 =
D3AC
> >
>=20
> _______________________________________________
> Mono-list maillist  -  Mono-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list