Draft
Area under the graph
8kzm
Loading description...
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.
Duplicate.
Ok, agree. I un-published it, but i can't see where i can delete it. If you can you can delete this kata.
You can delete a kata only if nobody's passed the tests, but as soon as you publish it your own solution is counted. The only thing you can do is unpublish the kata (maybe one day we will be able to delete drafts with completions in the future, who knows).
Please do not round internediate or final results. Look into
assertApproxEquals
( or its Node 10 equivalent ), and use that.There are technical reasons for this which take longer to explain than I am willing to do at this moment, because they've been explained elsewhere already, numerous times.
I use only integers as value of x and y in input points. Because of this, the decimal part of output will always be 0 or 5. So i just remove sentese about rounding in description, and still use assertEqual. It is ok ?
That's actually OK IN THIS CASE, because you're not really using floating point numbers, but fixed point numbers which can be accurately represented by IEEE-I always forget which one ( 754? ).
In general, it would NOT be OK!
Floating point numbers are a wasp's nest and it's very easy to get stung. You would really do yourself a favour by finding some existing explanation in the comments and making sure you understand the issues ( if you don't already ).