Ad
  • Custom User Avatar

    I suggest to put in the instructions that the tests are performed against perfect float point number equality or else I would implement a fixed error tolerance (myVar.toFixed(margin)).


    Indeed it wasn't too hard to solve the kata, I had to learn a lot about regex though.
    The difficult part was dealing with having to go through strings such as 0.6666666e+10, which I couldn't figure out why were giving me errors, until I realized I had to parse these strings and return an exact number in order to pass the test (by exact number I don't just mean a number, I mean the number expected by the test case with zero error tolerance).

    If the purpose of this is to add difficulty to the problem then I would state in the instructions that long floating numbers might appear (i.e. 1.232323232e+n) and the test cases have a zero error tolerance, otherwise I think it's a nice kata

  • Custom User Avatar

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