Fixed prototype.
Added a test case for negative numbers (failure).
Merged pull request #580