reddit/reddit — pull request #583 by iangreenleaf (2012-11-16 23:52:54+00:00)
Title: Fix "hot" algorithm to treat negative score sanely

The hot algorithm applies the "sign" of a post's score weirdly. This [has been noticed before](http://bibwild.wordpress.com/2012/05/08/reddit-story-ranking-algorithm/).

The time-based value is a large value that grows over time, so applying the sign to that yields weird results for posts with negative score. Not only do posts with a negative score rank lower than all positive posts, but *older* negative posts actually rank higher than *newer* negative posts, all else being equal.

Here's what I mean:

```python
_hot(1, 0, 1262304000) #=> 2850.0
_hot(0, 1, 1262304000) #=> -2851.0
_hot(0, 1, 1353107345) #=> -4869.0
```

With this patch, it returns much more expected values:

```python
_hot(1, 0, 1262304000) #=> 2850.0
_hot(0, 1, 1262304000) #=> 2850.0
_hot(0, 1, 1353107345) #=> 4868.0
```