The Wayback Machine - https://web.archive.org/web/20200520122132/https://github.com/TheAlgorithms/Python/pull/2013/files
Skip to content
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

Precision must be a nonnegative integer #2013

Merged
merged 2 commits into from May 19, 2020
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.
@@ -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
@@ -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 = (
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.