-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfoo.c
More file actions
39 lines (36 loc) · 737 Bytes
/
foo.c
File metadata and controls
39 lines (36 loc) · 737 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
36
37
38
39
#include "foo.h"
/**
* @brief Sums two integer numbers.
*
* @param x First number.
* @param y Second number.
* @return int Sum of x and y.
*/
int summing(int x, int y) {
return x + y;
}
/**
* @brief Sums the vector y into x.
*
* @param x Accumulator vector.
* @param y Vector summed to x.
* @param len length of the vector.
*/
void sum_vectors(int* x, int* y, int len) {
for (int i = 0; i < len; i++) {
x[i] += y[i];
}
}
/**
* @brief Summs two complex numbers.
*
* @param x First complex number.
* @param y Second complex number.
* @return struct cpx Sum of x and y.
*/
struct cpx sum_cpx(struct cpx x, struct cpx y) {
struct cpx z;
z.r = x.r + y.r;
z.i = x.i + y.i;
return z;
}