Skip to content
Merged

Fix ruff #12515

Show file tree
Hide file tree
Changes from 6 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 project_euler/problem_002/sol4.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def solution(n: int = 4000000) -> int:
if n <= 0:
raise ValueError("Parameter n must be greater than or equal to one.")
getcontext().prec = 100
phi = (Decimal(5) ** Decimal(0.5) + 1) / Decimal(2)
phi = (Decimal(5) ** Decimal("0.5") + 1) / Decimal(2)

index = (math.floor(math.log(n * (phi + 2), phi) - 1) // 3) * 3 + 2
num = Decimal(round(phi ** Decimal(index + 1))) / (phi + 2)
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ lint.per-file-ignores."project_euler/problem_099/sol1.py" = [
lint.per-file-ignores."sorts/external_sort.py" = [
"SIM115",
]

lint.flake8-builtins.builtins-allowed-modules = [ "base64", "wave" ]

lint.mccabe.max-complexity = 17 # default: 10
lint.pylint.allow-magic-value-types = [
"float",
Expand Down
Loading