-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathheader.h
More file actions
53 lines (46 loc) · 1.12 KB
/
header.h
File metadata and controls
53 lines (46 loc) · 1.12 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef __CALCULATOR__
#define __CALCULATOR__
typedef struct complex_number
{
/* data */
int real,img;
}complex_number;
typedef enum error_t
{
ERROR_DIV_BY_ZERO = -2, /**< Division by 0 error */
ERROR_NULL_PTR = -1, /**< Null pointer dereferncing error */
SUCCESS = 0 /**< Compute operation is successful */
}error_t;
/**
* @brief Addition of two complex numbers.
*
* @param num1
* @param num2
* @return error_t
*/
error_t sum(complex_number num1,complex_number num2,complex_number* complex_sum);
/**
* @brief Subtraction of two complex numbers.
*
* @param num1
* @param num2
* @return error_t
*/
error_t difference(complex_number num1,complex_number num2,complex_number* complex_diff);
/**
* @brief Multiplication of two complex numbers.
*
* @param num1
* @param num2
* @return error_t
*/
error_t multiply(complex_number num1,complex_number num2,complex_number* complex_mul);
/**
* @brief Division of two complex numbers.
*
* @param num1
* @param num2
* @return error_t
*/
error_t division(complex_number num1,complex_number num2,complex_number* complex_div);
#endif