7 kyu
Convert To Scientific Notation
Loading description...
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.
The input number will always be in the range of 0 < num < 1,000,000,000,000
This statement is incorrect as random tests can go beyond this range.
Sorry about that, should be fixed now!
This is generally a very bad way of doing random tests, because probability of testing interesting inputs is close to 0. For example, there is ultra small chance of having a test for numbers < 1000, and very small chance of having a test for trailing zeros. You need to have better random generators to ensure good coverage of tested scenarios. You can take a look at example kata, especially the "Leap years" one, to see how to ensure good distribution of tested scenarios.
Thank you very much for all of these tips! I'll be sure to change this soon!
Example in description:
1000000 -> "1.000e6"
Tests:
It should be explained how trailing zeros should be handled, and there should be explicit fixed tests, and guaranteed random tests, for inputs with trailing zeros like
1000000
and1000001
.Sorry that's just my stupidity in writing the description, can you tell it's my first kata? :)
That's OK, we've all been there.
MAke sure to test for scenarios with different amounts of trailing zeros, like: 100000, 12000, 12300, 100001, 120001, 123001
Should be fixed now!
Trailing periods are still not explained, and not tested. Inputs in form
10000000
have no fixed tests and no random tests.The description needs to specify how to handle rounding of the last digit. For example, what is the expected answer for
2345678
, or999999
?Thank you for the feedback, clarification has been added to the description. The digits should just be truncated / rounded down.
This comment has been hidden.
Thank you for the tips, they are very much appreciated!