8 kyu
Improving Math.round(x)
3,716 of 3,725donaldsebleung
Loading description...
Fundamentals
Object-oriented Programming
Mathematics
Logic
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
This comment has been hidden.
exactly what I thought :'(
How can this be a mistake:
✘ Expected: 2.718281828, instead got: 2.718281829 ✔ Test Passed: Value == 2.7182818285
2.7182818285 rounds to 2.718281829, not to value that expected some troubles)
The first 16 digits of Euler's number is
e = 2.718281828459045 ...
so it actually rounds to2.718281828
when you round it to 9 decimal places, hope this helps :)I've already discovered how to solve it) Thx
Simple, nice and fair! :-)
The kata needs to have some test cases.
Here's a set I used:
probably a bit extreme to raise this as an issue as I have created a suggestion for example tests.
Thanks a lot for your example test cases; I will use them :)
pioraid your example test cases have been added. Issue resolved.
mattc, you're right. I clicked on minor issues (prior to reading the discourse) and it asked me why. I didn't think anything minor warranted an issue.
Adding example test cases would greatly improve the quality of this kata :)
Thanks for the feedback, example test cases have been added.