[Nickle] Bug in //

Carl Worth nickle@nickle.org
Wed, 11 Dec 2002 14:57:35 -0500


I've found a bug in the implementation of the // operator.

The specification says:

	x // y == floor(x / y)

which holds for some cases:

	> x = -3; y = 4;
	> floor(x / y)
	-1
	> x // y
	-1

but not for others:

	> x = 3; y = -4;
	> floor(x / y)
	-1
	> x // y
	0

-Carl

PS. Yes, this should explain why I kept failing in my attempts to
write a C function whose behavior matched the nickle // operator.