PandA-2024.02
documentation
tutorial_fpl_2017
lab4
materials
4.2
main.c
Go to the documentation of this file.
1
2
extern
int
plus
(
int
x
,
int
y);
3
extern
int
minus
(
int
x
,
int
y);
4
extern
int
times
(
int
x
,
int
y);
5
extern
int
times2
(
int
x
);
6
extern
int
divide
(
int
x
,
int
y);
7
8
// computes the expression (2 * (((a - b) + c) * d) - ((e / f) * g)) and
9
// compares it with the value in expected
10
int
compute
(
int
a,
int
b,
int
c,
int
d,
int
e,
int
f,
int
g,
int
expected)
11
{
12
return
expected !=
minus
(
13
times2
(
14
times
(
15
plus
(
16
minus
(a, b),
17
c
18
),
19
d
20
)
21
),
22
times
(
23
divide
(e, f),
24
g
25
)
26
);
27
28
}
times
int times(int x, int y)
Definition:
operations.c:3
divide
int divide(int x, int y)
Definition:
operations.c:5
compute
int compute(int a, int b, int c, int d, int e, int f, int g, int expected)
Definition:
main.c:10
plus
int plus(int x, int y)
Definition:
operations.c:1
minus
int minus(int x, int y)
Definition:
operations.c:2
times2
int times2(int x)
Definition:
operations.c:4
x
x
Return the smallest n such that 2^n >= _x.
Definition:
math_function.hpp:170
Generated on Mon Feb 12 2024 13:02:48 for PandA-2024.02 by
1.8.13