File tree 2 files changed +7
-7
lines changed
1-js/05-data-types/02-number/4-endless-loop-error
2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 1
- That's because ` i ` would never equal ` 10 ` .
1
+ ` i ` 는 절대 ` 10 ` 이 될 수 없어서 무한 루프가 발생합니다 .
2
2
3
- Run it to see the * real * values of ` i ` :
3
+ 코드를 실행해 실제 ` i ` 값을 확인해 봅시다.
4
4
5
5
``` js run
6
6
let i = 0 ;
@@ -10,8 +10,8 @@ while (i < 11) {
10
10
}
11
11
```
12
12
13
- None of them is exactly ` 10 ` .
13
+ 어떤 경우에도 ` i ` 는 ` 10 ` 이 될 수 없습니다 .
14
14
15
- Such things happen because of the precision losses when adding fractions like ` 0.2 ` .
15
+ 이런 일이 발생하는 이유는 ` 0.2 ` 와 같은 분수를 더할 때 정밀도 손실이 발생하기 때문입니다 .
16
16
17
- Conclusion: evade equality checks when working with decimal fractions .
17
+ 그러므로 소수나 분수를 대상으로 작업 할 땐 등호 비교를 피하세요 .
Original file line number Diff line number Diff line change @@ -2,9 +2,9 @@ importance: 4
2
2
3
3
---
4
4
5
- # An occasional infinite loop
5
+ # 무한 루프
6
6
7
- This loop is infinite. It never ends. Why ?
7
+ 아래 반복문은 무한대로 작동합니다. 왜 그럴까요 ?
8
8
9
9
``` js
10
10
let i = 0 ;
You can’t perform that action at this time.
0 commit comments