Skip to content

Added New Tests in Signum #10724

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
Oct 20, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added the type hint back
  • Loading branch information
imSanko committed Oct 20, 2023
commit b4ea39f5a704b25b6621ef9e5a0b77863d2ea75c
6 changes: 2 additions & 4 deletions maths/signum.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""


def signum(num) -> int:
def signum(num: float) -> int:
"""
Applies signum function on the number

Expand All @@ -15,9 +15,7 @@ def signum(num) -> int:
>>> signum(0)
0
>>> signum("a")
Traceback (most recent call last):
...
TypeError: '<' not supported between instances of 'str' and 'int'
0
>>> signum([])
0
>>> signum(-10)
Expand Down