Retired
[Code-Golf] Ceiling Rounding (retired)
Loading description...
Fundamentals
Restricted
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.
Is my solution even supposed to pass?
Yes, that is one of the solutions I had in mind.
But it will not work correctly for some inputs. For
x=1e-30
it will return 0, but should return 1.True, but your solution ended up working, and the tests only went as low/high as -1000/1000.
Oh, I see what you mean. Is this an example of a random test you recived?
But 1e-30 is in the range of -1000/1000.
mortonfox'solution will fail for inputs of magnitude of 1e-8: should return 1, but will return 0. Tests should reject these two solutions, or kata should explain why they are accepted.
No, I deliberately created a wrong solution because I expected the tests to be incorrect in this regard.
Will it be seen as lazy by saying in the description "Be careful of the decimal places?". I could also restrict the "round" function, if that would be better. I am trying to think of ways to not have faulty testing while still allowing for multiple solutions.
Lazy or not, "be careful" is not clear. In what way exactly do I have to be careful when creating a solution? How does me being careful help tests to reject my invalid solution?
I admit, "be careful" is pretty vauge. Maybe a warning saying "Random tests will have decimal digits longer than your given character limit."? (For the time being, this is what has been done.)