Retired

[Code-Golf] Ceiling Rounding (retired)

Description
Loading description...
Fundamentals
Restricted
  • Please sign in or sign up to leave a comment.
  • Captain Quack Avatar

    This comment has been hidden.

  • hobovsky Avatar

    Is my solution even supposed to pass?

    • Captain Quack Avatar

      Yes, that is one of the solutions I had in mind.

    • hobovsky Avatar

      But it will not work correctly for some inputs. For x=1e-30 it will return 0, but should return 1.

    • Captain Quack Avatar

      True, but your solution ended up working, and the tests only went as low/high as -1000/1000.

    • Captain Quack Avatar

      Oh, I see what you mean. Is this an example of a random test you recived?

    • hobovsky Avatar

      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.

    • hobovsky Avatar

      Oh, I see what you mean. Is this an example of a random test you recived?

      No, I deliberately created a wrong solution because I expected the tests to be incorrect in this regard.

    • Captain Quack Avatar

      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.

    • hobovsky Avatar

      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?

    • Captain Quack Avatar

      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.)