mirror of
https://github.com/krahets/hello-algo.git
synced 2026-09-22 14:26:34 +08:00
fix the annotation of large number problem
This commit is contained in:
@@ -369,10 +369,8 @@ $$
|
|||||||
=== "JavaScript"
|
=== "JavaScript"
|
||||||
|
|
||||||
```js title=""
|
```js title=""
|
||||||
// (i + j) 有可能超出 int 的取值范围
|
// JavaScript 中的数字足够大(最大数值为 1.7976931348623157e+308 )
|
||||||
let m = parseInt((i + j) / 2);
|
// 因此无需考虑大数越界问题
|
||||||
// 更换为此写法则不会越界
|
|
||||||
let m = parseInt(i + (j - i) / 2);
|
|
||||||
```
|
```
|
||||||
|
|
||||||
=== "TypeScript"
|
=== "TypeScript"
|
||||||
|
|||||||
Reference in New Issue
Block a user