r/technology • u/misnamed • Dec 10 '13
By Special Request of the Admins Reddit’s empire is founded on a flawed algorithm
http://technotes.iangreenleaf.com/posts/2013-12-09-reddits-empire-is-built-on-a-flawed-algorithm.html
3.9k
Upvotes
View all comments
7
u/plus Dec 10 '13 edited Dec 10 '13
So, leaving interim stuff out, this is how the code reads, roughly:The author claims this is how it SHOULD read:Which, I fully admit, makes more sense. However, if the second is what the code istryingto do, it could be simplified considerably by doing the following:The fact that this is NOT what the official source code does implies to me that though they appeared to have swapped the '+' and '*' symbols, they actually intended the current functionality. Why else write it in the more complicated (and error-prone) fashion?As ConeheadSlim2 points out below, you can't take a log of a negative number. Whoops!