Skip to content

Commit

Permalink
Precision must be a nonnegative integer (TheAlgorithms#2013)
Browse files Browse the repository at this point in the history
* Precision must be a nonnegative integer

* fixup! Format Python code with psf/black push

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
  • Loading branch information
cclauss and github-actions authored May 19, 2020
1 parent e6fdcc9 commit 1c62bd1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
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

0 comments on commit 1c62bd1

Please sign in to comment.