2018-11-15 15:07:05 +02:00
|
|
|
#include "calculator.h"
|
|
|
|
|
2018-11-15 15:21:34 +02:00
|
|
|
int Calculator::Add (double a, double b)
|
2018-11-15 15:07:05 +02:00
|
|
|
{
|
2018-11-15 15:21:34 +02:00
|
|
|
return a + b + 0.5;
|
2018-11-15 15:07:05 +02:00
|
|
|
}
|
2018-11-15 15:17:29 +02:00
|
|
|
|
2018-11-15 15:21:34 +02:00
|
|
|
int Calculator::Sub (double a, double b)
|
2018-11-15 15:17:29 +02:00
|
|
|
{
|
|
|
|
return Add (a, -b);
|
|
|
|
}
|
2018-11-15 15:43:25 +02:00
|
|
|
|
|
|
|
int Calculator::Mul (double a, double b)
|
|
|
|
{
|
|
|
|
return a * b + 0.5;
|
|
|
|
}
|