Ad
  • Default User Avatar

    I read "There's a rule that zeros must never be rounded!" as either
    CustomMath.Round(x, y, 0) == CustomMath.Round(x, y, 1)
    or
    CustomMath.Round(x.0, 0, 0) == x but CustomMath.Round(x.01, 0, 0) == x + 1
    So I took zeros to refer to a zero as a rounding decimal digit not as the entire number.
    It took some trial and error with the tests to work out what it was intended to mean.

  • Custom User Avatar

    Not an issue?

  • Custom User Avatar

    I appreciate your nice feedback.

    Actually in the description is stated that zeroes must not be rounded as follows:
    "There's a rule that zeros must never be rounded!"

    I've removed the JS.

  • Custom User Avatar

    Why

    Assert.AreEqual(0, CustomMath.Round(0.0m, 0, 0));
    

    while

    Assert.AreEqual(2, CustomMath.Round(1.0m, 0, 0));
    

    It's inconsistent. If you insist to do this, please put it in the description.

    • You forgot to remove the dummy JS version.
    • Needs Random Tests.
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution