mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-06 18:49:26 +08:00
Fix ruff (#12515)
* Empty commit * Fix * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix * Fix * Fix * updating DIRECTORY.md --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: MaximSmolskiy <MaximSmolskiy@users.noreply.github.com>
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user