Closed alexeyinkin closed 2 years ago
The return value is always double and never any other num because this method has division: value.toInt() + (remainder.toInt() / factor.toInt());
double
num
value.toInt() + (remainder.toInt() / factor.toInt());
Division of two ints produces double, even if it is 1/1. Then addition keeps it double.
1/1
The return value is always
double
and never any othernum
because this method has division:value.toInt() + (remainder.toInt() / factor.toInt());
Division of two ints produces
double
, even if it is1/1
. Then addition keeps it double.