Update binary_search.md

This commit is contained in:
Yudong Jin 2022-12-23 01:17:37 +08:00 committed by GitHub
parent c4c10afdb1
commit 539aeefc75
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -369,8 +369,10 @@ $$
=== "JavaScript"
```js title=""
// JavaScript 中的数字足够大(最大数值为 1.7976931348623157e+308
// 因此无需考虑大数越界问题
// (i + j) 有可能超出 int 的取值范围
let m = parseInt((i + j) / 2);
// 更换为此写法则不会越界
let m = parseInt(i + (j - i) / 2);
```
=== "TypeScript"