We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8c92cd9 commit 982c62fCopy full SHA for 982c62f
project_euler/problem_002/sol4.py
@@ -61,7 +61,7 @@ def solution(n: int = 4000000) -> int:
61
if n <= 0:
62
raise ValueError("Parameter n must be greater than or equal to one.")
63
getcontext().prec = 100
64
- phi = (Decimal(5) ** Decimal(0.5) + 1) / Decimal(2)
+ phi = (Decimal(5) ** Decimal("0.5") + 1) / Decimal(2)
65
66
index = (math.floor(math.log(n * (phi + 2), phi) - 1) // 3) * 3 + 2
67
num = Decimal(round(phi ** Decimal(index + 1))) / (phi + 2)
0 commit comments