7 kyu
Square Roots: Approximation
45 of 351narayanswa30663
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.
python new test framework is required. updated in this fork
Approved
Python 3.8 should be enabled.
Haskell : https://www.codewars.com/kumite/5bbbebb94c47242d61000084?sel=5bbbebb94c47242d61000084
actual
andexpected
are switched in the random tests.This comment has been hidden.
Sorry, but I don't seem to understand the question. What do you mean when you say it can be calculated if the next and previous perfect square are different?
This comment has been hidden.
Hi, thanks for the feedback. I've added "or equal to" for every instance of "less than" or "greater than" in the description, and added a clarification afterwards. Please let me know if it isn't clear. Thanks!
Now it's clear, cheers.
Python random test rounding function is incorrect.
This comment has been hidden.
This comment has been hidden.
I see nothing wrong the rounding: solutions seem to work fine with both
base + round(..., 2)
andround(base + ..., 2)
ss
may be whole, but due to floating point representation, you can't be sure thatsqrt(ss)
yields an integer. So if you don't applyround
at the end, your solution can yield a wrong result.The kata description says
That is rounded to the nearest hunderdth, not tenth.
Would you please revise the text here?
Thanks for bringing this to my attention. It's fixed now.
Minor issue - Point 6. of your instructions 'which is 14.59, rounded to the nearest tenth' : tenth should be hundredth. Thanks
Thanks for bringing this to my attention. It's fixed now.