The Adventures of Joshua Judson Rosen
(action man)

[ sections: VisualIDs | art | movies | everything ]


Sun, 04 Jan 2009
[@]

00:59: Modulus

Apparently, -1 mod n in C is -1, not n-1.

Contrast with Python, where it's n-1.

That's why that code wasn't working right.

The funny thing is..., I was reading over the code, and I said to myself:

Hunh--clever. I didn't think I would have thought of doing that at that point.

I guess I wasn't quite as smart as I didn't remember being, after all.

[Reply]