[Mono-dev] [PATCH] Math.Truncate

Sebastien Pouliot sebastien.pouliot at gmail.com
Tue Jun 20 13:14:46 EDT 2006


Hey,

Small comments before committing...

+               Assert (Double.MaxValue == Math.Round
(Double.MaxValue));
+               Assert (Double.MinValue == Math.Round
(Double.MinValue));

You should add a small string to each assert, so we know exactly which
one fails.

+               Assert (Decimal.MaxValue == Math.Truncate
(Decimal.MaxValue));
+               Assert (Decimal.MaxValue == Math.Truncate
(Decimal.MaxValue));

I guess the second one should be MinValue ;-)
and same comment about adding a string

Thanks for the test cases!

On Tue, 2006-06-20 at 17:49 +0200, Jb Evain wrote:
> Hi,
> 
> Here is a new version of the patch that is more correct.
> It includes tests as well.
> 
> Jb
> On Jun 20, 2006, at 2:15 PM, Zoltan Varga wrote:
> 
> >                           Hi,
> >
> >   I'm no math expert, but truncation is most likely not the same as  
> > rounding,
> > so this patch would probably lead to hard to track down errors later.
> >
> >              Zoltan
> >
> > On 6/20/06, Jb Evain <mono at evain.net> wrote:
> >> Hello,
> >>
> >> This patch implements the new methods Math.Truncate.
> >> Is it ok?
> >>
> >> Jb
> >>
> >>
> >>
> >> _______________________________________________
> >> Mono-devel-list mailing list
> >> Mono-devel-list at lists.ximian.com
> >> http://lists.ximian.com/mailman/listinfo/mono-devel-list
> >>
> >>
> >>
> >>
> > _______________________________________________
> > Mono-devel-list mailing list
> > Mono-devel-list at lists.ximian.com
> > http://lists.ximian.com/mailman/listinfo/mono-devel-list
> 
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
-- 
Sebastien Pouliot  <sebastien at ximian.com>
Blog: http://pages.infinit.net/ctech/




More information about the Mono-devel-list mailing list