Update binary_search.md
Edited number out of bound topic
This commit is contained in:
parent
b580b29b66
commit
75ffa5180e
@ -328,7 +328,10 @@ $$
|
|||||||
=== "Go"
|
=== "Go"
|
||||||
|
|
||||||
```go title=""
|
```go title=""
|
||||||
|
// (i + j) 有可能超出 int 的取值范围
|
||||||
|
m := (i + j) / 2
|
||||||
|
// 更换为此写法则不会越界
|
||||||
|
m := i + (j - i) / 2
|
||||||
```
|
```
|
||||||
|
|
||||||
=== "JavaScript"
|
=== "JavaScript"
|
||||||
|
Loading…
Reference in New Issue
Block a user