Ad
  • Custom User Avatar

    Same issue here, worked on my machine and failed for 450010, and thanks to you I changed :math.pow(n,3) |> round to nnn
    I guess this is part of the difficulty : you have to know every nook and cranny of the language you use :)

  • Custom User Avatar

    It is - I think - test 109:

    Test 109
      1) test sum_fracts (SumfractsTest)
         fixture:10
         Assertion with == failed
         code: Sumfracts.sum_fracts(u) == ans
         lhs:  {239033687673439875, 44847850151521494}
         rhs:  {79677895891146625, 14949283383840498}
    

    You can see that lhs and rhs are different. Can't you print the input and your ouput?

  • Custom User Avatar

    Isn'it test 109 instead of 111 where you are stuck?

  • Custom User Avatar

    As you could have seen I slightly modified the description and give a hint in each language where it is helpful. It was one of my first kata, now I'm using some kind of "fuzzy assert" where I test if abs(actual - expected) is less than a given tolerance.
    Thanks for your post.

  • Custom User Avatar

    When rounding doesn't fit try truncating since it seems that your value is a bit too high.
    I added something about that in "Your solution" for Elixir and you could have a look at it.
    Thanks for your post.
    I answer late but I have just been notified, CW has problems!

  • Custom User Avatar

    Right, forgot it, fixed. Thanks!

  • Custom User Avatar
  • Custom User Avatar

    Maybe you don't need big decimals?

  • Custom User Avatar

    Did you solve the kata in Elixir? As often as possible avoid math.pow in many languages which is not precise enough for big numbers.