double amount;
amount=34.87;
int remainingAmount = static_cast<int(amount * 100);
static_cast assigns the result as 3486 not 3487
whereas it does assign correctly for other values, e.g.,
24.87; 2487; static_cast 2487,
44.87; 4487; static_cast 4487,
why can it be so?
Thanks,
Fatih