Ad
  • Custom User Avatar

    Hi,

    I tried to solve this kata in Crystal. Unfortunately I have two issues:

    1. using the round 10 doesn't work as expected. All 16 decimals are returned then:
      expected: [10, 3.0418396189]
      got: [10, 3.0418396186909367]
      on the other hand using round 9 returns a value as expected:
      expected: [10, 3.0418396189]
      got: [10, 3.041839619]
      It's just my third kata in Crystal, so I don't know if I'm doing something wrong or it's just a bug in Crystal
    2. Even if rounding up to ten decimals would work as expected (for me) there is still a difference. Maybe it's due to floating point precision stuff ...?
      a) first test
      expected: [10, 3.0418396189]
      got: [10, 3.0418396186909367]
      b) second test
      expected: [100, 3.1315929036]
      got: [100, 3.1315929033839542]
      c) thrid test
      expected: [1000, 3.1405926538]
      got: [1000, 3.1405926539827576]
      d) fourth test
      expected: [10000, 3.1414926536]
      got: [10000, 3.1414926533677505]

    Any ideas?

    Thanks in advance

  • Custom User Avatar

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

  • Custom User Avatar

    I was wondering if a 7th kyu grade is skilled enough to solve this kata this way, as it is a beginner's grade.
    My expectation has been (from a java point of view):
    8th kyu -> brute force solution with simple type int
    7th kyu -> brute force solution with BigInteger (for I have to use the object's methods and constants)
    6th kyu -> performing a bit-wise operation for enhancement

    What do you think?

  • Custom User Avatar

    Why not adding a link to mathworld ( http://mathworld.wolfram.com/Determinant.html ) inside the kata description for some theory background about determinants?

  • Custom User Avatar

    Ah, I see. No problem, just would've been nice...err naughty...nevermind ;-)

  • Custom User Avatar

    I would like to be on the naughty list :-)