Works now for large input.

I think the math pow function works on double and has precision loss for
large input.