- Notifications
You must be signed in to change notification settings - Fork44
Numbers#187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Open
ImVietnam wants to merge26 commits intojavascript-tutorial:masterChoose a base branch fromImVietnam:patch-12
base:master
Could not load branches
Branch not found:{{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline, and old review comments may become outdated.
Uh oh!
There was an error while loading.Please reload this page.
Open
Numbers#187
Changes fromall commits
Commits
Show all changes
26 commits Select commitHold shift + click to select a range
4365ba1 Update article.md
ImVietnam5da7be6 Update article.md
ImVietnam1430c8d Update article.md
ImVietnam69acf8f Update task.md
ImVietnam2c3cef6 Update solution.md
ImVietnam3ebf36c Update solution.md
ImVietnam6834241 Update task.md
ImVietnam782d857 Update solution.md
ImVietnamb1de3f1 Update solution.js
ImVietnam059ff7a Update task.md
ImVietnam2908af2 Update solution.md
ImVietnam8cf3f4b Update task.md
ImVietnama931a6a Update solution.md
ImVietnamb15b0c9 Update task.md
ImVietnam0e97f7f Update solution.md
ImVietnam632c312 Update task.md
ImVietnam08d656c Update solution.md
ImVietnam0df3c2d Update solution.md
ImVietnam5356af5 syne with en version
ImVietnam99be2ad sync with en version
ImVietnam9be2fc0 some fixes
ImVietnamb89a1fd some fixes
ImVietnam9b51129 some fixes
ImVietnamde563a4 some fixes
ImVietnam8f16068 Merge branch 'javascript-tutorial:master' into patch-12
ImVietnamb67c8bf Merge branch 'javascript-tutorial:master' into patch-12
ImVietnamFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
8 changes: 4 additions & 4 deletions1-js/05-data-types/02-number/1-sum-interface/solution.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,12 @@ | ||
| ```js run demo | ||
| let a = +prompt("Số đầu tiên?", ""); | ||
| let b = +prompt("Số thứ hai?", ""); | ||
| alert( a + b ); | ||
| ``` | ||
| Lưu ý dấu cộng đơn nguyên`+`trước `prompt`.Nó ngay lập tức chuyển đổi giá trị thành một số. | ||
| Nếu không, `a`và `b`sẽ là chuỗi, tổng của chúng sẽ là phần nối của chúng, nghĩa là: `"1" + "2" = "12"`. |
6 changes: 3 additions & 3 deletions1-js/05-data-types/02-number/1-sum-interface/task.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
18 changes: 9 additions & 9 deletions1-js/05-data-types/02-number/2-why-rounded-down/solution.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,33 +1,33 @@ | ||
| Bên trong, phân số thập phân `6,35`là một số nhị phân vô tận. Như mọi khi trong những trường hợp như vậy, nó được lưu trữ với độ chính xác bị mất. | ||
| Hãy xem nào: | ||
| ```js run | ||
| alert( 6.35.toFixed(20) ); // 6.34999999999999964473 | ||
| ``` | ||
| Mất độ chính xác có thể gây ra cả tăng và giảm số. Trong trường hợp cụ thể này, con số trở nên nhỏ hơn một chút, đó là lý do tại sao nó được làm tròn xuống. | ||
| Và `1,35` là gì? | ||
| ```js run | ||
| alert( 1.35.toFixed(20) ); // 1.35000000000000008882 | ||
| ``` | ||
| Ở đây, độ chính xác bị mất khiến con số lớn hơn một chút, vì vậy nó được làm tròn lên. | ||
| **Làm cách nào để chúng ta có thể khắc phục sự cố với`6.35`nếu chúng ta muốn nó được làm tròn đúng cách?** | ||
| Chúng ta nên đưa nó đến gần một số nguyên hơn trước khi làm tròn: | ||
| ```js run | ||
| alert( (6.35 * 10).toFixed(20) ); // 63.50000000000000000000 | ||
| ``` | ||
| Lưu ý rằng`63,5`hoàn toàn không mất độ chính xác. Đó là vì phần thập phân `0,5`thực ra là`1/2`.Các phân số chia cho lũy thừa của`2`được biểu diễn chính xác trong hệ thống nhị phân, bây giờ chúng ta có thể làm tròn nó: | ||
| ```js run | ||
| alert( Math.round(6.35 * 10) / 10); // 6.35 -> 63.5 -> 64(làm tròn) -> 6.4 | ||
| ``` | ||
10 changes: 5 additions & 5 deletions1-js/05-data-types/02-number/2-why-rounded-down/task.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions1-js/05-data-types/02-number/3-repeat-until-number/_js.view/solution.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions1-js/05-data-types/02-number/3-repeat-until-number/solution.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions1-js/05-data-types/02-number/3-repeat-until-number/task.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions1-js/05-data-types/02-number/4-endless-loop-error/solution.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions1-js/05-data-types/02-number/4-endless-loop-error/task.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions1-js/05-data-types/02-number/8-random-min-max/solution.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions1-js/05-data-types/02-number/8-random-min-max/task.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
26 changes: 13 additions & 13 deletions1-js/05-data-types/02-number/9-random-int-min-max/solution.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions1-js/05-data-types/02-number/9-random-int-min-max/task.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.