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.
holy heavens!
ill take notes!
Ok, I agree.
This comment is hidden because it contains spoiler information about the solution
That's a design decision you have to make for yourself when writing code. Here on a specialized coding problems site where each kata is specifics-bounded and undefined behavior doesn't matter, it doesn't. In real world where you should have more failsafes, you should. Also you're posting a spoiler, you need to mark it as spoiler.
This comment is hidden because it contains spoiler information about the solution
Fixed.
Fixed.
Fixed.
this was unnesessarily beautiful :V
Here's the relevant text from the description again.
"Not checked for any specific sign" means "returning any zero is considered correct without regard for its sign", or in other words "both positive and negative zero are correct results when the expected output is zero".
Is there any further confusion?
makeNegative(0); // return 0
Your returns are -0.
How is this correct?
@ToPraLLl I think you need to read the description and the other user's comment again more carefully. They are correct.
makeNegative(0); // return 0
Your returns are -0.
How is this correct?
Are you nuts? The task requirements is "Zero (0) is not checked for any specific sign. Negative zeros make no mathematical sense." and you're saying expected behavior is incorrect.
When I specify 0, the code outputs -0, but this is incorrect according to the task requirements.
Loading more items...