[Nickle] Bugs using // with large negative dividend

Bart Massey nickle@nickle.org
Fri, 13 Dec 2002 11:11:09 -0800


Ouch again.  Fixed again.  Boy do we need a test suite.
Thanks!

	Bart

In message <15866.1731.903763.986290@scream.east.isi.edu> you wrote:
> Here's some more mystic behavior of the // operator.
> 
> When the magnitude of a negative dividend exceeds some threshold, the
> direction of the rounding changes:
> 
> 	> a=-200000000;
> 	> b=-3;
> 	> a//b
> 	66666666
> 	> 10*a//b
> 	666666667
> 
> 	> a=-200000000;
> 	> b=3
> 	> a//b
> 	-66666667
> 	> 10*a//b
> 	-666666666
> 
> Positive dividends do not appear to tickle the bug.
> 
> Also, results yielding a fractional part less than 0.5 seem to be
> unaffected as well.
> 
> -Carl
> 
> PS. I don't know whether my attempt to validate the trapezoid
> implementation using nickle is finding more bugs in the trapezoid code
> or in nickle. ;-)
> 
> _______________________________________________
> Nickle mailing list
> Nickle@nickle.org
> http://nickle.org/mailman/listinfo/nickle
>