Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
@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.This comment is hidden because it contains spoiler information about the solution
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.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.
Do you ever perform two
sqrt
s in a single quadratic call?