Ad
  • Custom User Avatar

    @hey - The count of sqrt calls is over every test, not just a single call. That is why that test is at the end.

    That makes sense to me. You'd completely cut out that sqrt call. I don't understand what's unclear and/or stupid about that.

    I don't know what's going on with that perf test, but Math.sqrt is a notoriously expensive in all environments and languages. That is why this kata is aimed at reducing those calls as much as possible.

  • Default User Avatar

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

  • Default User Avatar

    I agree, this is a bit silly. I am only using ONE Math.sqrt() call. I calculate my determinant, then create var root = Math.sqrt(determinant); How is that FIVE calls? I am calling it once in the function.

  • Custom User Avatar

    The answer is almost certainly yes, as my solution got away with the stated minimum number of sqrts. Could you paste in your code, and mark it as "spoiler"? Maybe I (or someone else) could figure it out.

  • Custom User Avatar

    Do you ever perform two sqrts in a single quadratic call?