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.
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
This comment is hidden because it contains spoiler information about the solution
They already exist, or they're never gonna.
Closing.
Is it really an issue? ;-)
Fixed
In the case of -0, just add a 0 to it.
Suggestions for additional tests:
Still compilers tend to ignore that and return random values instead.
Encountered that behaviour often enough with GCC during code golfs.
this is fun!!
First two lines are really optional, but in my humble opinion there are two main reasons to use them:
Readability even if it makes your code slightly larger;
If we have some condition which prefer us to go line by line through the code and execute it we can specify that condition and return from function to save resources. Naturally in this small example this advantage is insignificantly.
Not if you care about readability.
the first 2 lines are unnecessary :)
There's still a rare problem though: division by +0 gives +Infinity and division by -0 gives -Infinity, and they are not equal.
Loading more items...