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 behaviour is by design.
Int
wraps. (Int
might be 64 bits, but will always be bounded. )signum
andabs
is not tested.But in case you are wondering, the math answer for
diff signum
should be:What is the expected return of
This comment is hidden because it contains spoiler information about the solution
Indeed, there is a bug in haskell translation:
For very large int, (read x) will give an wrong result: (Int is not a big int, it allows only 2^32 at most)
I think the read function is not important, as it always returns Int
However, the test do not respect the big int. Because I am new to codewars, I am not sure how to contribute to the kata test.