Skip to content

Commit 3091a73

Browse files
authored
chore(formatting): apply code formatting for search binary search on real values iii
1 parent 974b60a commit 3091a73

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed
Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
double max_value = 1e9 + 7;
2-
double index = 0.0;
3-
double jump = max_value;
4-
for(int iter = 0; iter < 100; ++iter) {
5-
if(jump+index<max_value && !ok(jump+index)) {
6-
index += jump;
1+
double low = 0.0, high = inf, delta = inf;
2+
for (int iter = 0; iter < 100; ++iter) {
3+
if (delta + low < high && !works(delta + low)) {
4+
low += delta;
75
}
8-
jump /= 2.0;
6+
delta /= 2.0;
97
}
10-
// index
8+
// low

0 commit comments

Comments
 (0)