Draft

Area under the graph

Description
Loading description...
  • Please sign in or sign up to leave a comment.
  • FArekkusu Avatar
    • kzm Avatar

      Ok, agree. I un-published it, but i can't see where i can delete it. If you can you can delete this kata.

    • FArekkusu Avatar

      You can delete a kata only if nobody's passed the tests, but as soon as you publish it your own solution is counted. The only thing you can do is unpublish the kata (maybe one day we will be able to delete drafts with completions in the future, who knows).

      Issue marked resolved by FArekkusu 6 years ago
  • JohanWiltink Avatar

    Please do not round internediate or final results. Look into assertApproxEquals ( or its Node 10 equivalent ), and use that.

    There are technical reasons for this which take longer to explain than I am willing to do at this moment, because they've been explained elsewhere already, numerous times.

    • kzm Avatar

      I use only integers as value of x and y in input points. Because of this, the decimal part of output will always be 0 or 5. So i just remove sentese about rounding in description, and still use assertEqual. It is ok ?

    • JohanWiltink Avatar

      That's actually OK IN THIS CASE, because you're not really using floating point numbers, but fixed point numbers which can be accurately represented by IEEE-I always forget which one ( 754? ).

      In general, it would NOT be OK!

      Floating point numbers are a wasp's nest and it's very easy to get stung. You would really do yourself a favour by finding some existing explanation in the comments and making sure you understand the issues ( if you don't already ).

      Suggestion marked resolved by JohanWiltink 6 years ago