fix truncation error

To convert float to integer the truncation is performed, but the
rounding is expected.

Test: Add (4.9, 4.9) should return 10.
Signed-off-by: Sergii Piatakov <sergii.piatakov@globallogic.com>
This commit is contained in:
Sergii Piatakov 2018-11-15 15:28:04 +02:00
parent cbcb06d48a
commit 4ad40a3b45
1 changed files with 1 additions and 1 deletions

View File

@ -2,7 +2,7 @@
int Calculator::Add (double a, double b)
{
return a + b;
return a + b + 0.5;
}
int Calculator::Sub (double a, double b)