diff --git a/docs/chapter_searching/binary_search.md b/docs/chapter_searching/binary_search.md index 04dbba8a0..0a407ff91 100644 --- a/docs/chapter_searching/binary_search.md +++ b/docs/chapter_searching/binary_search.md @@ -328,7 +328,10 @@ $$ === "Go" ```go title="" - + // (i + j) 有可能超出 int 的取值范围 + m := (i + j) / 2 + // 更换为此写法则不会越界 + m := i + (j - i) / 2 ``` === "JavaScript"