I have this method for calculating Mod:
private static double calcMod(double yVal, int nVal) {
return yVal % nVal;
}
Where
- yVal = 2.5469420819186795316622496024263e+46
- nVal = 187
when I calculate it with calculator the result equals 2, however, the returned value equals 97.0, can anyone explain how to use BigDecimal to get the expected result which is = 2.
Comments
Post a Comment