8 kyu
Assemblearning - Clamp
97ehpc
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.
I've never learned assemly in school so even though the kata is easy in its nature, but I learned a lot. Thanks OP.
Approved :)
I suggest to change all types to uint64_t. First of all, negative numbers are not tested so it makes sense to change all types to unsigned. And it is better to use uint64_t from stdint.h to avoid confusion with unsigned long and unsigned long long. Also, the upper bound of inputs could be increased to 2^64 - 1.
Done.
Sample and fixed tests have no error messages.
Fixed.
This does not guarantee the constraint due to overflow
Fixed.
Still not fixed.
This comment has been hidden.
Now it's fixed.
Tests have no error messages.
Could you please elaborate on that?
Have you ever seen the default error messages in criterion?
The expression (clamp(a, lo, hi)) == (tclamp(a, lo, hi)) is false.
is completely useless.Fixed.
Error messages should also contain actual result.
This comment has been hidden.