6 kyu
Expressive Objects
93joh_pot
Loading description...
Fundamentals
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.
For those who will try) dont forget about the order!
The fixed tests should provide examples where the order of four operations are shuffled
The example test should be explained further by listing out each operations step-wise
Node 12 should be enabled (Refer this and this for more info)
Very interesting kata, thank you! :)
Very happy you enjoyed it. Thanks for taking time out to complete it.
I can't get past the rounding errors in the randomised tests. Could you add some tolerance for those? (I pass all the hand-coded tests, by the way.)
There shouldnt be any rounding errors. My solution doesnt do any rounding. Could you post your code?
Enough users have passed this kata to show that there is no rounding problem. Have a look at the order that you evaluate the final operation using the root key. The random tests
left
andright
operands don't start withadd
first, so maybe that is your issue.I mean slight variations in the way a solution is implemented could cause tiny differences in the resulting number, because of rounding errors inherent in any operation involving big/small numbers. My solution is of by maybe 0.01%, that kind of thing, simply because I chose to implement it in a different way to the author's solution. This can be "fixed" by allowing for that in the tests themselves.
What do you mean by "the order that you evaluate the final operation using the root key"? I am evaluating left and right, then doing
left op right
, and returning that result.Code to follow...
This comment has been hidden.
This comment has been hidden.
Let me see,I have same problem.
This comment has been hidden.