Add non-power-of-two check to GenericMath.

Signed-off-by: Nick Minkler <sleaker@gmail.com>