, :
arrayName[0] = (14*100)/49.0;
Thus, you only convert the last calculation to double instead of the beginning and reduce the number of floating point calculations.
Btw, if you want, you can also get the result as an integer using the same method of exchanging order and use multiplication before division, for example: 14 * 100/49 instead of (14/49) * 100.
source
share