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.
The first multiplication on the second line is the inverse of the function call on the first, the compiler shouldn't expect that, and the whole point of the multiplication is that it's not an inverse of the square root.
Caching repeated expressions is something every compiler is expected to know how to do, along with commuting additions and multiplications and inlining of small functions. Sometimes they'll even convert a cached value into a repeated expression, if they decide that register allocation is worth the extra CPU cycle. And modern CPUs won't even need that extra cycle.
By extra work, do you mean the ternary? I think it's better than spending five lines on the same.
It happens in Ruby at least
This comment is hidden because it contains spoiler information about the solution
can I be given a gist of how this works?
That's a bug/feature with the output console. It interprets the stuff output as HTML rather than as plain text.
Cute. It wouldn't pass any code review, but it's still cute.
This comment is hidden because it contains spoiler information about the solution
too few semicolons for my taste ;-)
Specification should not rely on Wikipedia to provide the definition of non-standard nomenclature. "constant R" is not standardised terminology in the context of arithmetic sequences.
Also, "elementh" is not a word. "Element" is (with the plural being "elements"). Also, "you" should not be capitalised. Only "I" gets the privilege because it's a single letter. Neither should "sum" be in all caps. Use proper formatting for emphasis - but this description is small enough to not need emphasis anyways.
Also, you should probably increase the range and count of your test cases.
Needs more test cases. Preferably a suite of random tests.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Upvoting just for the visuals ;-)
hmm... call
method_missing
manually? :-DLoading more items...