I found that marking What is your best programmer joke? as a favorite removes the number of people having set it as a favorite and resets it to 2, and subsequently unmarking it will set the number to 1. Refreshing the page with it marked shows the proper number again, but then unmarking it as a favorite will set the number to 0 marking it as a favorite again at this point changes the number to 1. This seems to hold true for other high favorited counts as well, such as Hidden Features of C#?

  • 2
    I'll keep doing it until they tell me I'm crazy. It keeps coming back to me. That damned joke question. If you like it so much why don't you just marry it. And I'll unfavourite their questions. Or become a moderator so that I can delete it permanently. Favourites. Also I could try unfavouriting it. Then I'll downvote them. And then marry it. It's questions like this that make me wish I could downvote something more than once. Always there with its off-topic upvotes and favourites. Downvoting their children. But then I would have to keep downvoting it until there's nothing left. – Welbog Jan 21 '10 at 20:42
  • Haha... sorry to have sent you into a psychotic break there... it was just where I happened to be when I noticed it. I don't have time to read ALL 19 PAGES of answers at once, otherwise it wouldn't really be favorite material. But I can call the men in white coats for you if needed, just say the word. :P – Nathan Wheeler Jan 21 '10 at 20:47
  • 4
    When those men come, I will downvote them. – Welbog Jan 21 '10 at 20:52
  • youtube.com/watch?v=hnzHtm1jhL4 – Pollyanna Jan 22 '10 at 3:30

My guess is it has something to do with adding or subtracting 1 from the number.

When creating a greasemonkey script, I ran into the problem with the formating of numbers, as they use 40k for 40000 or 1,000 for 1000. Both of these formats are regularly un-proccessable by Javascript without knowing about them before hand.

I ended up having to create a function that would translate StackOverflow numbers into regular parse-able numbers.

In jQuery, the function that updates the count is probably something like this:

score = parseInt($('#favorite_count').text(), 10);



What is happening is the `parseInt' sees the comma, and then stops reading the number. Therefore truncating it to 1.


1+1 = 2 


1-1 = 0

Following that logic, any question with 2,000 favorites will show 3 when you favorite it, and 1 when you unfavorite it.

The only reason we haven't figured this out till now is because there really hasn't been that many questions that get 1,000+ favorites, and we mostly deal with 1s, 10s, and 100s. All three of these do not have any special formating, and therefore have worked.

The problem is that you would have to parse the number, make a modification, and then reformat it, and then display it.

| improve this answer | |
  • My guess is that your guess is right. I hadn't thought about the comma in there. – Nathan Wheeler Jan 21 '10 at 20:41

Excellent find! Edge case, however.

| improve this answer | |
  • Agreed, doesn't effect the usability of the site either, even where it effects the UI. Just thought it was worth a mention in the case that someone didn't have enough to work on (yeah, riiight) and wanted something to do. – Nathan Wheeler Jan 21 '10 at 20:39

Rounding error. Favorite counts are stored as a 3 bit floating point number.

Don't ask why, just accept it and move on.

| improve this answer | |
  • ???????????????????????????????????? – Tyler Carter Jan 21 '10 at 20:58
  • do you mean 3-byte? – Lance Roberts Jan 21 '10 at 21:00
  • 3
    Just a joke, folks. – Pollyanna Jan 21 '10 at 21:14
  • 1
    Dang, it's true, though :) – Jarrod Dixon Jan 24 '10 at 10:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .