5 kyu
No Return #3: Solve the Equation
Loading description...
Mathematics
Algorithms
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.
i got errors like:
this is disappoint me because if u calculate it will be:
but if u (u know) fix it to 982.269 its will be the right answear so why do not just return 982.269 instead of 982.2689999999999 ?
Not a kata suggestion, it's a question. And if x is -982.2689999999999 then the equation becomes this:
The problem is in the sign, you're returning it wrong.
I finally got it but it's the most disgusting ternary i've ever written lol. This one was tough for me.
At first I thought "why?", but then I figured "why not?" 🙃
This comment has been hidden.
Why are the tests running the solution twice for each test?
What do you mean? User's solution is called once and reference solution is called once.
Example tests.
Whoops, sorry for that.
OK, you've made your point. Can we now go back to using
return
when it's more natural to do so?Short answer is
yes
. It's not that I'm coercing you to solve my katas.Nevertheless, thank you for your feedback and your time.
I actually prefer to avoid
return
when possible. Such a clumsy and bulky word for something so primitive.