bool interval_union float float float float out float out float if if

 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
bool interval_union (float a, float b, float c, float b,
out float e, out float f) {
e = a; f = b;
if (c > a) {
if (c > b) {
e = c; f = d;
return false;
} else if (d > b) {
f = d;
} else {
f = b;
}
} else {
e = c;
if (d < a) {
f = d;
return false;
} else if (d > b) {
f = d;
}
}
return true;
}