Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: Reputation: -4 (+-0.5 -3.5)

by RMGir (Prior)
on Jul 21, 2019 at 12:17 UTC ( [id://11103096]=note: print w/replies, xml ) Need Help??


in reply to Re: Reputation: -4 (+-0.5 -3.5)
in thread Reputation: -4 (+-0.5 -3.5)

> the larger bit of me thinks we should keep it

I agree, but I'm really curious to know HOW it's happening. Aren't votes integers? Hard to imagine an int update race the results in a float conversion :)


Mike

Replies are listed 'Best First'.
Re^3: Reputation: -4 (+-0.5 -3.5)
by LanX (Saint) on Jul 21, 2019 at 13:40 UTC
    > Aren't votes integers?

    They most likely are.

    But before displaying them calculations happen °:

    from node_rep_line

    14: my $up = ($N->{reputation} + $N->{votescast}) / 2; 15: my $down = $up - $N->{reputation};

    Looks like reputation was -4 and votescast 3 at the moment of my observation.

    Hence one votecast got lost ...

    update

    I seem to remember reading about a "multiple vote feature" (for janitors?) announced some month ago.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

    °) @PmDevs I somehow "reverse engineered" this bug, because I was expecting a division by two. Search internal code for all code snippets with "vote" and narrowing the result to / 2 led me to this part.

      Thanks, that explains it nicely!

      It's interesting that it's not a transient issue: the votes are still fractional, so an update to votescast was likely permanently lost rather than you just seeing "torn values".

      Reputation: -8 (+1.5 -9.5)

      Mike
        > It's interesting that it's not a transient issue:

        Looks logical to me, one down-vote only made it to rep but not to votescast, the DB wont store any other info.

        Seems like the desire to show "up" and "down" votes separately, came long after the DB model was established.

        This explains also why the display of it can be toggled in the settings.

        Cheers Rolf
        (addicted to the Perl Programming Language :)
        Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11103096]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2024-04-24 11:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found