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.
If you're looking for results from thinking about this kata, you will gain a lot of insight.
Found it funny that one of the random test I got was zero to the zero power. This special case should be covered in the description as either 1 or undefined.
Scala translation
Approved some time ago
C# translation ready! Please review and approve.
Java translation added.
That test looks for
**
in your code, False means it was, True, it wasn't.And what does False and True have to do with it? But, thanks for the answer anyway. I have put the task in bookmarks
But ** is not a function, it's an operator
You can't use ** in your code, as the error message says.
I have one test that doesn't pass. Message: No ** allowed: False should equal True. Where does False come from if there is no comparison expression? I don't understand anything
This comment is hidden because it contains spoiler information about the solution
It's basic math:
x^0 = 1 if x != 0
. For0^0
see this wikipedia article.How do you get 1 when 10 isn't to the power of anything? I could understand 10 * 0 = 0 thus giving an error, but where the fuck does the 1 come from?
What if number = 0 and power = negative?
Loading more items...