Ad
  • Default User Avatar

    some languages do, some dont. re-raising here with a list of affected languages

  • Default User Avatar

    the tests suite should use approximate equality in:

    • Haskell
    • PHP
    • Python
    • Ruby
    • Scala

    other languages are OK

  • Custom User Avatar

    Yes, it was.

  • Default User Avatar

    it looks fine to me, perhaps it was patched at some point, can you check if it's ok now ?

  • Default User Avatar

    OP is gone and his latest code passes the kata. The C++ tests suite does take care of printing the actual/expected with enough decimals. Closing as lacking details.

  • Default User Avatar

    Return the result rounded to two decimals.

    It is the rounded result that is compared to the expected solution with fuzzy equality. You have to round the number yourself. And ± 1e-9 is more precise than ± 1e-2, not less.

    (Asking for rounded results is bad practice, but it's too late to change the kata now).

  • Default User Avatar

    yeah i just realized, took me some time but its actually pretty obvious. should probably have waited a little before commenting

  • Custom User Avatar

    .... but it's exactly this, there's not much more to this problem. You are given the lenght of the arc A. This is enough to calculate the area of the red square. Your task is to figure out how, and code the solution.

    It might be not immediately obvious how to use the length of the arc to get to the area of the square, but this is what users are expected to figure out.

  • Default User Avatar

    the instructions are way to vague, what am i even supposed to do with the arc length? it just says "calculate the area of the square, also you have this arc length, have fun!"