Joined February 2013
·

Jared Davis

Software Engineer at KennaSecurity
·
Chicago, IL
·
·

Posted to The Concept of Pointers over 1 year ago

no code examples in this post?

Posted to A Better Fibonacci over 1 year ago

@ludwinas corrected, thanks

Posted to Index of minimum element of a list over 1 year ago

very cool. Can you explain a bit more about what it means that "the default order of tuples in Python is lexicographical" ?

Posted to A Better Fibonacci over 1 year ago

Thanks for the comments, @davidka !

Try reading http://www.skorks.com/2010/05/ruby-procs-and-lambdas-and-the-difference-between-them/ for a better explanation of Ruby's lambda's than I'm able to provide.

If you're interested in reading more about PHI, I recommend Mario Livio's The Golden Ratio for starters. It's been a long time since I've read it, but I recall the book having a good overview of the number and it's history -- including the supposed Parthenon interpretation.

Posted to A Better Fibonacci over 1 year ago

@antonov nice!

Keep the advice coming everyone; I'll refactor over the weekend -- Thanks!

Posted to A Better Fibonacci over 1 year ago

@alfre2v Yes, that's absolutely correct, and for two reasons. 1) The value of PHI used here is a standard Ruby Float, where as the mathematical constant is transcendental (infinite, non-repeating decimal). 2) Not all real numbers are representable by floating point numbers of any size.

The largest Fibonnaci number discoverable by this code is n = 1474,

49922546054780146353198579531352153533212840109029466994098142197617303359523104269471455390562835412104406019654730583800904132982935807202575490044075132631203284854890505808877430837618493577512703453928379390874730829906652067545822236147772760444400628059249610784412153766674534014113720760876471943168

which does not match the known value for the 1474th Fibonnaci.

I'm going to give others a chance to calculate where the computed and actual series diverge; but if someone doesn't I'll post the answer ( finding the answer shouldn't take more than a few minutes ).

Achievements
355 Karma
72,206 Total ProTip Views
Interests & Skills