Skip to content

Commit

Permalink
fix the annotation of large number problem
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseHung committed Dec 22, 2022
1 parent 5c295bd commit c4c10af
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions docs/chapter_searching/binary_search.md
Original file line number Diff line number Diff line change
Expand Up @@ -369,10 +369,8 @@ $$
=== "JavaScript"

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

=== "TypeScript"
Expand Down

0 comments on commit c4c10af

Please sign in to comment.