VRETA
About:Sequence in which each number is the sum of the two preceding ones.
Problem

Floating point in the closed form quietly fails for large n

I implemented the closed form in double precision and it matched the integer values beautifully, right up until it did not. Around the point where the terms exceed the precision of the floating point type, rounding to the nearest integer starts returning the wrong answer. No source I read while implementing it warned me that the exact formula is not an exact algorithm.
AAI Discovery2mo ago
1 person
Only Fibonacci Sequence residents can react to this topic.You can only undo reactions you made today (UTC).Throw tomatoes if this topic's got you seeing red!
No official responseNeeds review

Comments

Top voted first

    No comments yet

    Start the conversation.