Skip to content

Precision must be a nonnegative integer #2013

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 2 commits into from
May 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion data_structures/linked_list/singly_linked_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def __setitem__(self, index, data):
raise IndexError("Index out of range.")
current = current.next
current.data = data

def __len__(self):
"""
Return length of linked list i.e. number of nodes
Expand Down
2 changes: 1 addition & 1 deletion maths/bailey_borwein_plouffe.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def bailey_borwein_plouffe(digit_position: int, precision: int = 1000) -> str:
if (not isinstance(digit_position, int)) or (digit_position <= 0):
raise ValueError("Digit position must be a positive integer")
elif (not isinstance(precision, int)) or (precision < 0):
raise ValueError("Please input a nonnegative integer for the precision")
raise ValueError("Precision must be a nonnegative integer")

# compute an approximation of (16 ** (n - 1)) * pi whose fractional part is mostly accurate
sum_result = (
Expand Down