Ad
  • Custom User Avatar

    Someone even checks if they are equal, causing [false, false] to return true.

    Test cases are sadly lacking ..

  • Custom User Avatar

    Thanks for the link!

  • Custom User Avatar

    I made the change, thanks for the tip! Could you give me a good link to the NUnit Framework?

  • Custom User Avatar

    It seems that the problem is only with C#. ASAP I will try with a tolerance of 0.000002 in C#. What do you think of that?

  • Custom User Avatar

    Are you talking about C#? I don't see from MSDN that Assert.AreEqual accepts tolerance as a parameter but I could be wrong... Unfortunately there was no guide for that at CW and there is not one, even now.
    I wrote this kata rather long time ago. I used the DELTA parameter in Java for this kata and now for this kind of kata I'm using a kind of assertFuzzyEqual in all languages. Nevertheless lots of guys passed the kata (373) which proves that it is doable:-)
    BTW I don't see very well how you truncate ".9999999999 to 0, with only .0000000001 error". Furthermore I didn't ask for rounding but for truncating. The problem doesn't come from truncating it comes from the way languages work with floating numbers and from the order in wich operations are done.
    Give me some reference for Assert.AreEqual with a tolerance parameter and I will try to modify it when I have time but I am afraid that tolerance doesn't exist in the other languages.
    Thanks for your feedback.

  • Default User Avatar

    You're right,

    however the point of this kata is to create a simple class with some methods not a best practice class.

    Aside from that, considering how many people have done this kata it's a bit to late to change : )