5 kyu

Count Decimal Places

361 of 367edalorzo
Description
Loading description...
Algorithms
  • Please sign in or sign up to leave a comment.
  • user9644768 Avatar

    No random tests.

  • KlenofJupiter Avatar

    I just wrote a solution to this (my first 5 kyu problem!), and it works perfectly in my repl, but exactly one case (2.e-14) keeps coming back as failed. In my repl, it produces the expected output (14), but I keep getting the same message here that it produces an output of 0. Any idea what's up with this or what I can do? Thanks so much! (also, sorry if this is not the appropriate forum for this kind of question).

  • GiacomoSorbi Avatar

    Nice kata, just translated into both Ruby and Python, if you want to approve them :)

    [And writing the Python version without regexes was rather fun, I must admit ;)]

  • laoris Avatar

    Thanks for writing this kata, edalorzo! Some comments though:

    I think you should add a test case for a number > 10 that has more than one significant digit. For instance, 160, or 175. I say this because my first solution wouldn't have handled this correctly, though I think my current solution does.

    Also the description should really mention how NaN and infinity should be handled, and not leave the user to discover this from the test cases.

    IMO, the kata description could also be more helpful by explaining what a decimal place is.

    • edalorzo Avatar

      Thanks for your feedback. I have addressed all your comments to my best understanding of your requirements. I hope that makes this Kata better.

  • theipott Avatar

    The coffeescript is not written properly. You just copied the Javascript declarations.

    • edalorzo Avatar

      I will review it later, for the time being I will get rid of the coffee script version of the code. Thanks for the feedback.