Introduce checks for integer overflow during division.

Historically, Android would refuse to
perform calculations on memory grounds for large values
or would cast to an int and produce incorrect result for
diffScales outside of the int range.

This change adds a check to prevent scale overflow for
large scale division.

Bug: 17393664
Change-Id: I090c271bb02379f35d3c4392aa38be2bb0cf431f
Merge "Introduce checks for integer overflow during division."