Ad
  • Custom User Avatar

    Not just time o_O

  • Default User Avatar

    @dfhwze - @hobovsky himself was thinking about this... 5 years ago!

    https://www.codewars.com/kata/563e320cee5dddcf77000158/discuss#5b017f8ede4c7f95e60000e8

    Time truly is a flat circle.

  • Custom User Avatar

    thank goodness there are no negative numbers in this kata to round down to the nearest integer

  • Default User Avatar

    Hey @KayleighWasTaken - thanks for the explanation (and for all the work you do on improving Codewars).

    I stand corrected then; and my apologies to the OP, you, and @hobovsky if I closed the issue too quickly.

    I also decided to read the entire Discourse thread for the kata and it turns out that indeed several other people have complained/been confused by this.

    Perhaps, then, in addition to anything you and @hobovsky decide to modify, an actual numerical example in the Description would be a helpful un-ambiguous addition.

    For example: 17.3 -> 17 17.6 -> 17 17.999999 -> 17, to really drive home the point.

  • Custom User Avatar

    I already talked about this on the discord server, but as a native English speaker, Rounded down to the nearest integer makes perfect sense. You have the operation (rounding), the direction (down), and the target (the nearest integer per the direction). It never really has occurred to me that it could be ambiguous, which is most likely a factor of ESL speakers native tongues handling such grammatical cases differently.

    I would propose that the verbiage floor(ed) or ceil(ing)(ed) could be used as a hopefully truly unambiguous solution?

  • Default User Avatar

    Ah sorry I missed your reply - well, the auto-translate put the emphasis on "nearest integer" but what the OP's mistake was (and the reason I thought I would close issue) is because in his text he mistakenly says that kata asks for:

    "rounded up to nearest integer"

    and I corrected that the description in fact asks for "rounded down". In other words, without the nuance of understanding his language, I thought he was making a basic reading mistake.

    Again maybe this is due to Russian word for rounding, rounding up, flooring, etc being hard to translate (yet another reason for keeping Discourse to 1 language only).

    As for your comment; I agree, but apparently it's idiomatic (probably outside of mathematical/technical use?) in native english to say "round down" - https://en.wiktionary.org/wiki/round_down

  • Custom User Avatar

    Still, "rounded down to its nearest integer sounds a bit confusing, doesnt it? It's either down, or to nearest? Or it's just me (and the OP, apparently)?

  • Default User Avatar

    Please post in English in general, and especially if you raise Issues since we are supposed to read and try to understand.

    Using Google translate: I note that you make the following mistake (I think, if translator is correct) - you say "that the kata condition is to return average rounded up to the NEAREST INTEGER" but the kata clearly states:

    "Return the average of the given array rounded down to its nearest integer."

    edit - i've checked in Python and indeed the behavior is as expected, using 2 different ways to get the "rounding down"

  • Default User Avatar

    There is no error in description, it didnt ask you to copy paste the descsription. its possible solutions