# Discussion on: Project Euler #2 - Even Fibonacci numbers

## Replies for: Math to the rescue again! To compute the n-th Fibonacci number, you can use the Binet formula: where φ is the Golden Ratio, (1 + √5)/2. Also, it... Nested Software

These are really great solutions. I think it would be worthwhile for you to publish them as standalone articles. One quibble: I don't think this is O(1) since arithmetic operations are not constant time as a function of input, although I guess as long as we’re sticking with floating point numbers O(1) is probably valid. edA‑qa mort‑ora‑y

You're correct that addition is `O(log N)` for a number N, or `O(log n)` where n is the number of digits. The power function `x^n` also has a `O(log N)` time complexity if `N` is an integer (I presume it's also linear on number of significant bits).

Given fixed sized types on a computer though I believe most of these become constant time, as the inputs have a fixed upper limit on bits. It probably involves an unrolled loop, or fixed iterations on a CPU.   