Ad
  • Custom User Avatar

    Thanks, I have made some changes in code,
    but with 1 last thing i desegree - try rounding 2.25.

    In my opinion Python uses round half to even, but in float result is affected by float-accuracy problem.

  • Custom User Avatar
    • Initial solution uses round instead of s_round
    • First sample test tests math.round
    • No fixed tests
    • Rounding to 0 significant figures doesn't make sense (and sometimes tests expect a result with 1 significant figure)
    • With non-integer results python's default rounding strategy is not "round half to (decimal) even" (e.g. round(2.45, 1) -> 2.5)
  • Custom User Avatar

    Rounding in decimal only to return the result rounded in binary doesn't make much sense in most situations.