[MATH-1068] Changed integer calculations with potential overflows to long.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1548907 13f79535-47bb-0310-9956-ffa450edef68
Merge upstream/trunk