-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcalculation.h
More file actions
35 lines (27 loc) · 775 Bytes
/
calculation.h
File metadata and controls
35 lines (27 loc) · 775 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef calculator_calculation_h
#define calculator_calculation_h
#include "utilities.h"
enum EOperation
{
EOperation_Nop = 0,
EOperation_Addition,
EOperation_Substract,
EOperation_Multiply,
EOperation_Divide,
EOperation_Xor,
EOperation_ShiftRight,
EOperation_ShiftLeft,
EOperation_RotateRight,
EOperation_RotateLeft,
EOperation_ChangeBase,
EOperation_ExitProgram,
EOperation_NumOfOperations,
EOperation_FirstOperation = EOperation_Addition
};
char* EOperation_ToString[];
int operationUsesOneOperand(enum EOperation op);
int operationUsesTwoOperands(enum EOperation op);
// does the operation op on the numbers a, b
enum EStatus calculate_result(int a, int b, enum EOperation op, int *result);
enum EStatus change_base(int a, enum EBase* base);
#endif