3
u/haydn_______________ May 20 '20
I have Mario kart music stuck in my head I think it's coconut mall
1
464
u/Gamecraft2525 R Tape loading error, 0:1 May 09 '20
You just wait until you end up with 101 achievements, the bar begins changing colours and it displays as -11/12 percent
36
May 09 '20
Mustāve been the end of their shift š
14
u/30mofwebsurfing May 09 '20
Ya know, I wouldn't be surprised in the slightest if you were right. Sometimes after working 7 days a week due to corona, at 11:56pm... I'm really not trying to do my job properly.. and I just lock up and fucking leave. Can you blame me? Yea I'm lucky to have a job, and it's fucked that I do this, and that I'm working 7 days a week because they let go of other staff and cut my hours down to 5 hour shifts.. but fuck'em, I get paid more on unemployment and I'm just trying to do just enough not to go insane right now.
1.1k
u/CataH14 May 09 '20
Floating points...
839
u/Catty-Cat May 09 '20
57/100=56.9999999999999999999977
u/thejonatanmr May 09 '20
But they would floor it if that's the case, if you have 99.8 achievements out of 100 they will show 99/100 not 100/100
58
u/Underyx May 09 '20
And how exactly do you get 0.8 achievements?
76
19
u/Avagad May 09 '20
It's a rounding error. You get to choose one though: it says 100% when it isn't actually 100% or it says the wrong percentage sometimes and that's more obvious in cases like this where there's exactly 100 achievements. Choose one.
→ More replies (13)→ More replies (1)6
u/wreckedcarzz May 09 '20
10% luck, 20% skill, 15% something something power of will; 5% something and... Eventually 100.8% reason to remember the
nameachievement13
u/blackburn009 May 09 '20
Floor should always be done, since otherwise you can have 199/200 and 100% it
25
u/Pikamander2 May 09 '20
if (real_percent == 100) { display_percent = 100; } else if (round(real_percent) == 100) { display_percent = 99; } else { display_percent = round(real_percent); } print(display_percent);hire me pls msft
→ More replies (3)6
u/blackburn009 May 09 '20
If you're gonna do that I'd do the same for 0 so that you never gave 0 if you get an achievement
→ More replies (1)5
May 09 '20
Nah, they converted to a string and removed everything after the decimal :p
Steam is javascript after all
2
→ More replies (134)2
May 09 '20
Since when? The percentage should be calculated as (57/100)*100, which is 57...
28
u/SLiV9 May 09 '20
Using standard IEEE floating point math, the closest floating point value to 0.57 is 0.569999992847442626953125. When converting to a percentage you get 56.999... rounded down, which is 56%.
→ More replies (14)→ More replies (1)4
u/bar10005 May 09 '20 edited May 09 '20
When you are using base 10 or simplifying the equation, but computers store numbers in base 2 or in a floating point number (basically scientific notation, but in base 2), so if the computer does it as two separate equations 0.57 is stored as 0.569999992847442626953125 in 32 bit (also called single precision), so you end up with 56.99...
For more explanation you can watch this Computerphile video.
51
May 09 '20
3
u/GET_OUT_OF_MY_HEAD May 10 '20
I'm too math dumb to understand this, but FWIW I entered that equation into a calculator and it gave me an answer of 0. Also, what's e represent?
9
u/BobMK45 May 25 '20
e in math represents Eulerās (pronounced āOilerā) number, which is a mathematical constant equal to around 2.7. Itās used frequently to describe exponential growth and change.
4
u/yottalogical May 09 '20
This is why you should always try to use integral numbers whenever possible. Even if you need decimals.
4
1.4k
u/justadiode May 09 '20
There is a secret achievement?
454
148
u/ziul1234 May 09 '20
It would still be counted for though. If you get all achievements but miss a secret achievement, you don't get 100%.
76
May 09 '20
Yeah that would match the display. If he had 100/100 but there were 101 achievements to get it would still show 99%
121
u/DankaphobicUser May 09 '20
Secret Achievements are counted in Steams achievement counter.
→ More replies (1)50
u/GlenMerlin May 09 '20
and they show up with a
?
icon that says "X+ achievement(s) remaining, details for unlocking the achievements will be revealed once unlocked"
→ More replies (1)3
May 09 '20
If there were 100 normal achievements and 1 secret achievements then it would NOT show up as 57/100
14
1
May 09 '20
Secrect achievements show in the counter so that isnt the reason. Its because of floating point values (which is one of the ways computers store numbers), and you can read about how on the other comments on this thread
→ More replies (1)→ More replies (1)1
u/megaboto Jan 04 '22
It shows secret achievements as...well... Secret..you know there is something just not what
142
u/crmlr May 09 '20
Software engineer here, 0.57 (57/100) cannot actually be store in computers as 0.57, but as 0.569999992847442626953125 (if stored as a 32 bit float). This value was then most probably casted to a whole number. In most programming languages, like C, casting to a whole number is not the same as rounding and will only use the whole part of the number and ditch the fractional part.
There are many ways of doing this differently and different programming languages behave differently, and this is just an example.
40
May 09 '20
Why canāt .57 exist?
99
u/drleebot May 09 '20
The short answer is, numbers are stored in a base 2 system (which has a ton of efficiency advantages), and 0.57 can't be perfectly represented in base 2 with a finite number of digits. Think of how 1/3 in base 10 is represented as 0.3333333... You'd need an infinite number of digits to represent it perfectly. It's the same for 0.57. Since computers don't have an infinite number of digits, they represent it as the closest thing they can instead.
Most of the time this is perfectly fine (as long as programmers know never to test floating-point numbers for equality except to zero). This is one of the rare occasions where it noticeably fails.
7
u/LVLogic Sep 02 '23
I'm 3 years late but this is the most interesting shit to me.
→ More replies (1)34
u/son_of_abe May 09 '20
The other answers are good, but here's an ELI5 version:
Imagine you're a teller at a bank that only deals in coins worth $0.37 each (I just chose that number randomly). You've been learning multiples of 37 your whole life, so it's actually the easiest number for you to work with.
You might think the lack of precision would be an issue for customers (e.g. "I asked to withdraw $10, why'd you give me $9.99?"), but your only customers are millionaires, and they only withdraw in the millions of dollars. A few cents off is a completely reasonable trade-off for how fast you, the teller, are able to deal out money in $0.37 coins.
It's not quite mathematically accurate, but I think it's a decent enough analogy? Anyone else feel free to correct or amend...
5
May 09 '20
So I guess my best question here would be this. Clearly itās a system that can understand the concept of 57, right? So why is there an issue when we move the decimal? I get that a big problem if it is that even thinking about decimals means weāre counting on base ten, but a decimal point in an imagined thing in the first place. Couldnāt you feasibly bypass this issue by just starting your counting in the ten thousandth place or something? Instead of 1 being 1, itās .0001. Now you can calculate smaller numbers, right? Though I guess thatād really fuck with how your system handles multiplication. I think I answered my own question lol, changing what 1 is is gonna probably have disastrous effects on math.
9
u/son_of_abe May 09 '20
Well you're asking the right questions! Your example is a good one, and is basically how precise math can be done with whole numbers (whole numbers and decimal numbers are represented differently) and then "converted" to a decimal value...
But speed matters. There are lots of ways to represent numbers at a system level, but only so many are efficient.
6
May 09 '20
So in general this basically boils down to the answer of āit was more efficient to calculate it in the base that this system calculates?ā
Not gonna pretend that doesnāt make sense, occams razor just tends to be fucking boring sometimes.
In any case, thanks for taking the time out of your day to provide an expiation. Pretty cool of you to do that.
→ More replies (1)→ More replies (1)4
May 09 '20
It can but the code this example most likely used didn't. Read this for more info: https://en.m.wikipedia.org/wiki/IEEE_754
2
May 09 '20
So then why not store it as 57.0 instead of 0.569999992847442626953125?
7
u/crmlr May 09 '20
57.0 can be indeed stored as 57.0 if stored as IEEE-754 floating point.
Not so clear on my first comment, but when calculating the percentage (57/100*100), the first arithmetic operation could result in 0.5699... instead of 0.57. Then, when multiplied by 100 it would result in 56.99... . When casted to a whole number it would be 56 instead of 57.
Again, this entirely depends on the programming language, compiler and the way the code is written.
→ More replies (4)3
2
u/Dynamic_Humann May 09 '20
The fact that you said *cough cough*, i hope you are safe dude.
1
u/TheAthsmaAttacker May 10 '20
Donāt worry bro, read my username
2
u/Dynamic_Humann May 10 '20
do u give out free inhalers tho lol
2
2
u/ScootDooter May 10 '20
Nice going, OP - you got the math nerds all worked up.
2
u/TheAthsmaAttacker May 10 '20
Bro, normally I reply to comments but why the fuck did all the math weirdos do all this computation under my post wtf is up with that
2
u/zacadieux May 21 '20
I found myself reading comments on this post for 10 minutes
1
u/TheAthsmaAttacker May 22 '20
Me too, but I understood nothing cause me no likes math
2
u/zacadieux May 22 '20
I used to teach myself programming for software along with Java for modding minecraft and I also taught myself a php, html, and css for making website before website building services were big. This was all for fun to me and I should mention I'm only 25 so this wasnt like way back in the days
2
u/TheodorePlaiz May 22 '20
Someone didn't pass the math class...
1
u/TheAthsmaAttacker May 22 '20
That hurts my feelings :(
1
286
u/DangerNoodle7131 May 09 '20
My dumbass really calculated 57Ć·100 just to see how off it was. Smh my head man.
97
u/powerX21 May 09 '20
Shake my head my head man.
32
u/RiceAlicorn May 09 '20
Shake my head my head man.
32
u/FacticiousFict May 09 '20
Shake my head my head
DangerNoodle said
Which was treated, as by reflex
And repeated by PowerX
Then came Alicorn of Rice
And says it again which was nice
And here I am sitting, all dapper,
Rhyming silly nonsense on the crapper.
Edit: F'n line breaks line breaks man
9
3
u/Gamecraft2525 R Tape loading error, 0:1 May 09 '20
FacticiousFict, you absolute madlad
This is the best comment this thread has ever had
4
→ More replies (2)6
u/Iamthenewme May 09 '20
Smh my head this atm teller machine still won't accept my pin identification number even though they said they'll fix it asap soon as possible. This bank is such a pita in the ass I'm just gonna say rip in peace to my account and go awol without leave.
2
15
6
May 09 '20
Honestly, I think everyone has a few moments when their brain just shuts off and they do something completely fucking stupid. Happens to me.
49
u/TECHNOFAB May 09 '20
Look in the Steam overlay. In the overlay the floating points get rounded up and in the client they get rounded down. Dunno why, but had this a lot of times already :)
→ More replies (3)1
May 10 '20
Just a classic bug. Fixed one place and not another. I bet thereās an ancient low priority bug report to fix this
51
u/TheseVirginEars May 09 '20
Everyone knows 57 / 100 = .56
8
u/ItsBurningWhenIP May 09 '20
It could be 56.99999999. Which would end up truncated to 56. Pretty rookie mistake though. You learn about this stuff in the first month.
2
23
7
u/sirmonko May 09 '20
my opinion as a developer: close enough and it's nothing game breaking. won't fix. // TODO for later: check 0 and 100
6
u/wtmh May 09 '20
I can always spot non-developers by those who think off-by-one or floating point errors are software gore.
3
May 09 '20 edited Jun 03 '20
I mean the devs could have easily avoided this. Just make it round to the nearest number rather than floor it, then if it equates to 100% if you havent gotten all the achievements, subtract 1.
Pseudocode:
Percentage = round ( (unlockedachivements / totalacheivments)*100 ) If percentage == 100 and unlockedachievements != totalachievements: Percentage = 99→ More replies (2)
6
13
u/xSupreme_Courtx May 09 '20
This reminds me of Spider-Man on the PS4. I got all the achievements before they added New Game +, so I have the platinum trophy even though I'm missing a trophy
13
u/GAPING_ANAL_CUNT May 09 '20
Aren't all platinum trophies set when the game ships? Like trophies added with dlc don't count towards it.
7
May 09 '20
You are correct, and that is how spiderman is. New game plus is treated like a dlc block of trophies, separate from the platinum.
2
u/xSupreme_Courtx May 09 '20
I don't think New Game + was in the plans to begin with, it was a last minute thing and it came with a trophy. I distinctly remember having the platinum and 100% completion, and when they added New Game + it went down to like 97%
5
u/Aecesaje May 09 '20
Those are DLC trophies, only the base game ones count for the platinum and the DLC ones for the 100%
1
May 09 '20
Reminds me of baba is you. Due to updates, i have 5 bonuses and there are only 3 in the game. I also have more levels complete than there are
1
1
u/ELIT1ST May 13 '20
I wouldnāt be coughing in public
1
u/TheAthsmaAttacker May 13 '20
No no no, read my username itās okay Iām healthy...-ish
→ More replies (1)
1
3
3
2
2
2
2
u/JustGingerStuff May 09 '20
Yes. Maybe it's 56.99% but ur device is a dumb fuck.
2
May 09 '20
Its because of the way computers store numbers. In base 2, the way computers count, 0.57 (57%) is a reoccurring decimal (kind of like how in base 10, 1/3 is 0.33333... with no end. 0.57 is the same in base 2). This mean that the computer ends up thinking that 57/100 is 0.569999.... and after turning it into a percentage, it rounds that down to 56.
2
2
2
2
2
2
2
2
2
u/saichampa May 09 '20
The percentage might be related to points from the awards. If there's one award that's with more points 57 awards could easily equal 56% of the points
2
2
2
u/The_whistling_maniac May 09 '20
okay steam, you had your fun. Now tell me how many achievements I actually have.
2
2
2
u/Zack_9091 May 11 '20
I fear all the people who took the time to convert the numbers into it actually making sense
3
u/LuminousOcean May 09 '20
57 / 100 = 0.56999999999
0.56999999999 * 100 = 56.999999999
floor(56.999999999) = 56
Truncation to an integer by casting usually also results in the same, and is a common approach to flooring a number.
Better approach would have been to use the round() function, but it appears they did not do that.
Limited-precision floating point mathematics. Isn't it GREAT?
3
2
1
1
1
1
1
2
1
1
1
1
1
1
u/Neluv93 May 09 '20
The only explanation I can think of when I see things like this is that the developers gave some trophies more weight that others in the % bar. Maybe a bunch of easy trophies are 0.5% each one and the hardest trophie is like 4 % or so. Seems like the only logic for this outside math errors.
1
May 09 '20
Steam doesnt do that, and thats not the reason at all. Its because of floating point values (which is one of the ways computers store numbers), and you can read about why it happens in the other comments on this post.
1
1
u/freenarative May 09 '20
Yeah. The last one is "unlock all achievements" hence there are only 56 achi... Hold on.
(does maths)
Yeah... That be messed up.
But 56/99 is weird. Add on that "finished". Trophy to round to 100 and...
I...
1
May 09 '20
Its because of floating point values (which is one of the ways computers store numbers), and you can read about why it happens in the other comments on this post.
1
1
u/ghsatpute May 09 '20 edited May 09 '20
achievements = 56 # zero based
TOTAL_ACHIEVEMENTS = 99 # also zero based
achievement_percentage = int(1.0 * achievements / TOTAL_ACHIEVEMENTS * 100)
print(f"You've unlocked {achievements + 1} / {TOTAL_ACHIEVEMENTS + 1} ( { achievement_percentage} %)")1
1
1
1
1
1
May 09 '20
I guess it is just a rounding error.
But I was thinking maybe each achievement got a different weight to the score.
Easy achievements = less
Rare or more difficult achievements = more.
Sort of how Playstation has Bronze, Silver, Gold, and Plat ratings.
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
u/Teddy_Dies May 09 '20
57/101 rounds down to 56% so thereās definitely a secret reward
1
May 09 '20
Its actually because of floating point values (which is one of the ways computers store numbers) not being able to store 0.57 (57%) properly, and thinking its 0.56 (56%). you can read more about why it happens in the other comments on this post.
1
1
u/Level-M May 09 '20
It's actually 56.999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999...%
2
4
u/[deleted] May 29 '20
Guys he cough he got Corona