Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
@RantSomeWhere i took the screenshot 10 hours ago, but couldn't post it back then. Maybe his points changed until then.
-
You know how negative binary numbers work? Maybe somebody forgot to add the sign flag ? :p
-
@Gregozor2121 i know how they work, but dfox either forgot negative scores or wanted to display then this way. Imo you should've colored the negative number in a bright yellow-green that pierces the eyes of every dark theme user.
-
korrat6347y@Gregozor2121 as someone pointed out in another rant everyone has a negative score. Two's complement only works if you got a fixed number of bits
-
endor57517y@korrat perhaps the scores are using two's complement, but leading zeroes are cut out?
A simple check would be to see if the guy with a negative score has a 32-bit value: I'm just eyeballing it, but I think that's the case.
So by my hypothesis, all users with negative upvotes will have a full 32-bit value (because negatives will all start with 1), while anyone else will have his score cut down to the first non-zero digit.
It's not conclusive proof without the source, but I think it makes a lot of sense -
Pointer32497y@endor It actually must be this way.
All negative numbers in binary form are two complements, and it makes sense that the 0's get left out because of the parsing method. -
@endor it's a truncated, unsigned, 32-bit integer. That's why his score is 4 billion and something
-
bioDan61597yIf you inverse the bits in the screenshot you get 1.
So at the time of your screenshot i believe he had -1 ++ -
korrat6347y@bioDan For two's complement you would add 1 after inverting the bits. So he would have -2.
-
endor57517y@AlgoRythm why would you use unsigned ints? A user's ++ can be negative too, it would make no sense
Found the king of devrant
rant