I'm happy that you all had so much fun with this.
Imalc: clearly that code is correct and fast, but for this project I'd rather stick to a lookup table that can be understood immediately, particularly since it's faster anyway. I was only wondering if there was a nicer syntax to initialize the array. As to "the original code using logs", that was never the original code; I only mentioned it as an example of what I didn't want to do so people wouldn't suggest it.
phantomotap: I've been meaning to ask you, where did you find that "LL" type suffix? I've never seen that before and can't find it documented anywhere.