Add missing check for invalid precision.
Merge pull request #35 from DataValues/fix-division-by-zero

Add missing check for invalid precision.