2.1k
u/accountability_bot Aug 14 '20
If it's an unsigned int, then the actual max value is $4,294,967,295.
542
u/Illusi Aug 14 '20
But what if it's a badly implemented unsigned int that gets cast back and forth to normal ints?
287
u/NorbiPeti Aug 14 '20
Then it'd be either 4 billion or -1 :P
216
u/Xero125 Aug 14 '20
Thus, the expected value is two billion
345
u/vigilantcomicpenguin Aug 14 '20
Here we observe the statistician in its natural habitat.
→ More replies (3)58
u/EvoG Aug 14 '20
Casting -1 to an unsigned integer in a managed language would throw an exception, instead of just rolling with it and underflowing.
→ More replies (2)62
u/gracicot Aug 14 '20
In C and C++, unsigned integer over/underflowing is defined behavior.
static_cast<std::uint32_t>(-1)will give the max value, no matter the platform or architecture.→ More replies (10)3
u/Pagefile Aug 14 '20
Could be unsigned in memory and signed in input.
Bloodstained: Ritual of the Night sort of does this with the randomizer. Seeds are 4 byte values, but the input field for using a custom seed (and the generator I assume) only allows positive signed int values. However the game will run just fine if you have it generate a seed and modify it in memory before the game actually starts.
I'm unsure if the code treats the seed itself as unsigned or signed, but it doesn't use the whole valid range in either case without a little bit of persuading.
→ More replies (7)24
u/cztrollolcz Aug 14 '20
Wouldnt this be stored in a long? [Newbie]
→ More replies (10)54
u/BakuhatsuK Aug 14 '20
Yes. There are billionaires out there so that should be probably a long. Or rather actually:
Noob: unsigned int dollars
Beginner: unsigned long dollars
Intermediate: unsigned long cents
Advanced: long cents (unsigned is bad unless you need módulo arithmetic or dealing with bit patterns)
Pro: BigInteger cents
Galaxy brain: String dollars (MONEY, DECIMAL or VARCHAR for DB, BigDecimal for calculations)
International currency: You don't want to go there, but if you have to, start by storing the currency name alongside the value.
27
u/brimston3- Aug 14 '20
Gotta store them fractional cents so you can siphon them off into another account, only to panic once you realize you've made a horrible math error. Is there still time to change careers and sell magazines door to door?
→ More replies (2)10
u/cosmicosmo4 Aug 14 '20
International currency: You don't want to go there, but if you have to, start by storing the currency name alongside the value.
List of (quantity, currency) tuples. You can have more than one.
→ More replies (1)→ More replies (2)5
523
u/BagOfShenanigans Aug 14 '20 edited Oct 15 '25
quaint direction heavy consider fly money bike oil party offbeat
This post was mass deleted and anonymized with Redact
258
u/Cl0udRider Aug 14 '20
Mom: hey I think I heard the baby say something!
Baby: yahoo yahoo yahoo yah-ya-ya
Mom: oh no
60
28
10
3
u/TheMightyBiz Aug 15 '20
The image of a baby clipping out of the womb as a speed strat is one I never thought I needed
35
u/TobiasCB Aug 14 '20
It's pretty dangerous though, the baby could end up outside the QPU grid.
10
u/p1-o2 Aug 14 '20
Is there a maximum number of QPUs? I know you can travel in three dimensions of parallel universes with them but I've never heard of any boundaries.
11
u/TobiasCB Aug 14 '20
No, but you'll have to stay QPU aligned so it's easier to go back to the main universe.
6
u/Multibe Aug 14 '20
Mario's position is stored as a float, so yeah, the INF PUs are the boundaries with (-INF, -INF, -INF) and (INF, INF, INF) being the corners, altough PUs in that perimeter aren't reachable since you would need your speed to also be INF, which crashes both the game and the universe.
8
→ More replies (2)2
u/zrrt1 Aug 15 '20
So, to explain the frame rule, imagine that a bus is leaving the womb each 21 frames...
491
u/MyKidsArentOnReddit Aug 14 '20
Doesn't matter, they'll still need a loan to pay for college.
→ More replies (1)139
85
u/InternetAccount06 Aug 14 '20
Tried it, baby's still broke as fuck and my wife thinks I'm more of an idiot than she did yesterday.
276
u/PSBars Aug 14 '20
TIL your baby starts off with runescape max cash you take its dollar away
58
u/CutlassFuryX Aug 14 '20
As soon as I hop back on that game I start seeing that number everywhere lol
→ More replies (1)17
→ More replies (4)4
45
u/shadowphrogg32642342 Aug 14 '20
but it's signed
39
141
u/rkeet Aug 14 '20
Imagine doing this to a 64bit system where the max (signed) value is: 9,223,372,036,854,775,807
119
u/elzaidir Aug 14 '20
You'll end up with -1, if it's signed
69
u/Gooftwit Aug 14 '20
-1 or 9 sextillion? I'll take that bet.
60
→ More replies (3)4
u/EvoG Aug 14 '20
There is no bet if the integer is signed like rkeet said, so you'll just lose that dollar.
→ More replies (3)
119
u/behaaki Aug 14 '20
Imagine that actually worked, and then you’re stuck paying taxes on that amount..
64
38
u/Booleard Aug 14 '20
That's not a problem when cash is what you're getting. It sucks for people that win things like cars or houses because they can't just pay the taxes with 50% of the prize.
14
u/behaaki Aug 14 '20
Oh I figured you wouldn’t actually get the cash, because systems — but they’d still expect you to pay taxes
28
u/Booleard Aug 14 '20
Back in the 90s I played a BBS door game called Legend Of The Red Dragon.
There was a poorly written module that allowed you to bet negative money, so you could just keep betting until you lost. I always gambled 2 billion less than I had, so when I lost it would subtract negative 2bil from my money.
6
u/DOOManiac Aug 14 '20
That’s almost as lucky as flirting with Violet and not getting her sister instead.
4
u/Booleard Aug 14 '20
Lol! I thought I had reached the peak of personal goals when I married Violet.
→ More replies (1)
17
u/shaystibelman Aug 14 '20
so this Reddit post is a tweet with a discord screenshot, huh...
8
14
u/DontLickTheGecko Aug 14 '20
Honest to God there's a straw man theory out there that's not that far off from this. In a previous customer facing job I had the unfortunate pleasure to deal with a guy who thought he could buy his social security number back from us so he could cancel all his debts.
9
u/CounterHit Aug 14 '20
After going down the sovereign citizen rabbit hole, I believe it.
4
u/MechroBlaster Aug 14 '20
After hearing the sovereign citizen spiel and what they believe, I 100% agree with you.
I also believe there are people who legit think this way.
4
u/CounterHit Aug 14 '20
Oh, there for sure are people who actually believe this stuff. Check out this video, the whole thing is hilarious. There's bunches of these on YouTube. It's honestly crazy how many people seem to believe this stuff is legit.
100
Aug 14 '20
How do your social security numbers work? How does that relate to immediate personal capital?
320
u/iCapn Aug 14 '20
This may come as a shock, but jokes on discord are not always an accurate source of financial education
118
u/evilmonkey2 Aug 14 '20
Are you sure? Cause I was about ready to try to get my wife pregnant based on this post. I could be rich. Rich beyond my wildest dreams!
→ More replies (1)53
u/Self_Reddicating Aug 14 '20
With children, you'll discover that feeling regardless of their dollar value.
→ More replies (3)25
9
u/stormfield Aug 14 '20
Obviously you're just a shill for Big Accurate Financial Education who's trying to sell economics lessons.
→ More replies (8)5
u/CowboyLaw Aug 14 '20
This isn’t a joke though. This is part of the Sovereign Citizen belief that your SSN is tied to your corporate personhood and...I’m not typing anything more because it’ll make my fingers dumber. Anyway, it’s not a joke, the person who wrote it is a kook (or they’re a normal person repeating kookery as a joke). If you want to know more (and, really, no), just Google sovereign citizen social security.
→ More replies (1)17
u/proboardslolv6 Aug 14 '20
Social security numbers are meant to track your lifetime contributions to the social security system, which helps determine your payout when you need it.
Since there is no national ID or citizen registry in the US, various government bodies such as the IRS have coopted your SSN to identify you for virtually everything
12
u/z7q2 Aug 14 '20 edited Aug 14 '20
https://www.ssa.gov/history/ibm.html
SSA's first computer was an IBM 705. I'm lost looking at the specs, so what matters more in this case, the 7 bit interface, or the variable length strings?
https://en.wikipedia.org/wiki/IBM_700/7000_series#Commercial_architecture_(702/705/7080)
Edit: Bonus 705 Tube porn
11
u/nelusbelus Aug 14 '20
That's not how it works. 0 -1 as int won't loop around. 2147... (e.g. 231 -1) is the max of a signed int. Signed int under/overflow is generally undefined. Signed uint underflow loops back around to 4294... (e.g. 232 -1).
10
u/Vok250 Aug 14 '20
I can tell you from experience that the system handles negative money. Having negative money is actually the majority use case :(
14
7
7
6
6
5
Aug 14 '20
Tell my student loans that people's value is unsigned :c.
Maybe in a decade I'll have a positive net worth.
Oh wait no, the mortgage.
Maybe when I'm dead.
4
4
4
u/Digital_001 Aug 15 '20
Y'all are assuming the government tax systems count in dollars... surely it would be in cents?
1
u/KanyaStrange Sep 03 '20
I've barley been on reddit over the last year and I'm glad I did. Why does there have to be this Twitter screenshot, it adds nothing of value. Just cut out the middle mad and just post the Discord screenshot, the actual content. In other words:
padding: 0;
1
u/wtfevenislifelol Sep 05 '20
if you look closely, the discord user id the same person as the Twitter user. They have the same username. It's the same person.
adds nothing of value
he provides context by saying they were discussing parenting life hacks.
I don't get what people have against screenshots of screenshots of screenshots. I don't see anything wrong with it. If i make a joke on discord, am i not allowed to share that joke with the rest of the internet?
padding 0
what an interesting connection your brain made
1
u/KanyaStrange Sep 05 '20
Only the Discord screenshot is the only relevant piece of content.
Fight. Me
1
3
u/jimbo_slice321 Aug 14 '20
Is that why that’s the max cash stack in OSRS?
2
2
u/techgineer13 Aug 14 '20 edited Aug 14 '20
Yep. The engine is written in Java, and all Java
ints are signed 32-bit integers, giving you a max cash value of 231 - 1, or 2.17b gp. This also works out to roughly $2000 USD if you sell your gp on the black market (don't do this, you WILL get banned), or roughly 19 years of membership if you spend it on bonds.Edit: Fixed exponent to include the sign bit
→ More replies (2)
3
3
3
3
u/Painfulyslowdeath Aug 14 '20
What logic/lines of code make it take an error like that and try to correct it by switching to the largest 32 bit integer?
→ More replies (2)
3
3
Aug 14 '20
Someone's been playing too much Civilization and trying to pull off the Gandhi bug in real life.
3
3
3
u/themeatbridge Aug 14 '20
This mother fucker doesn't think a person can have negative value. It's definitely a signed integer.
→ More replies (1)
3
3
u/squintsAndEyeballs Aug 14 '20
I came here (way too late) to talk IEEE 32 bit floating point standard. So proud of all my fellow nerds that beat me here
3
2
2
2
2
2
Aug 14 '20
What if it's a 64 bit unsigned integer?
4
u/das_Keks Aug 14 '20
Then Jeff Bezos isn't the richest person anymore.
2
Aug 14 '20
I mean, you'd have the entire world's GDP for the next 2279 years assuming that the integer represented cents.
2
2
2
2
u/heseme Aug 14 '20
That how it worked in "Mafia" on the C64:
Go to the casino, bet -50.000.000 dollars, hope very much that you dont win.
Profit!
2
2
2
2
u/yawya Aug 14 '20
but you need 40 SS credits to be entitled to benefits, and in order to earn those credits you have to work and make money, so the value is just gonna wrap back around again
2
2
2
u/SliceOfTy Aug 14 '20
Nothing prepared me more for that number than Old School Runescape. The baby would start with a max stack of gp!! Ez
2
2
2
2
2
2
Aug 14 '20
holy sh*t! i never expected to see a negative integer overflow reference on r/programmerhumour of all places!
upvotes! upvotes all around!
2
2
u/ChristianLW Aug 14 '20
So, it flips like an unsigned int, but the max value is that of a signed int... hmm...
2
2
2
2
u/CainPillar Aug 14 '20
Are you seriously saying that the US cannot handle you being born with nothing but a hospital bill?
2
2
u/ITriedLightningTendr Aug 15 '20
They'll have to spend it really quick or any value they make flips it over again
2
2
u/galaxypig Aug 15 '20
Granted. Now you owe hundreds of millions of dollars in taxes and you get arrested for tax evasion, going to prison for the rest of your life.
2
3
Aug 14 '20
Reminds me of that one pokemon red glitch where if you immediately fight a level five pidgey for something that has that same attck bonus, then take the exact right amount of steps and step pattern on your way to varidiean forest(without any additional encounters) then get into an encounter on the exact right tile in the forest you can catch a level -1 mew, which obviously doesnt work, so the game sets it to level 100 as soon as you catch it
2
u/techgineer13 Aug 14 '20
Actually, you catch a level 1 Mew (or literally anything else, even nonexistent pokemon, depending on the Special stat of the pokemon you fight for the glitch), then get it only one level using a rare candy to get it to level 100.
→ More replies (1)
2
1
1
1
u/imacleopard Aug 14 '20
I didn't pay attention to the sub name and though I was in r/amibeingdetained for near half of that paragraph.
Boy am I glad I was wrong.
1
1
1
1
1
1
1
1
1
1
1
1
1
1
u/Libertydown Aug 14 '20
Kinda feels strange that Jeff Bezos 60x that amount. He would break the bank
1
1
u/AnotherEuroWanker Aug 14 '20
You don't get far in life taking financial advice from people who can't tell the difference between their and they're.
1
1
1
Aug 14 '20 edited Aug 14 '20
Not sure how that'd work in practice; balances are usually either a float or double, or (in a lot of gov't applications) a fixed point number (e.g., DECIMAL(18, 2) in SQL). Neither of these have an underflow condition at 0.
1
1
u/Happy-Map7656 Aug 14 '20
Infants cry at night in hopes that you don't have another one. Maybe they know something.
1
1
1
1
1
1
1
1
1
Aug 14 '20
Man, is this how the wealthy people do it? They must've had a kid for the government to give them more money.
1
u/Nielsly Aug 14 '20
In runescape the maximum cash stack size is 2.1B, but some people have managed to glitch their money to -2, which gave them unlimited money for some reason, maybe it’s the same irl
1
1
1
u/Stompya Aug 14 '20
I’ve had a negative net worth for years. No wonder the whole country is so messed up.
1
1
1
1
1
1
1
1
1
1
1
1
1
1
4.0k
u/Traxin420 Aug 14 '20
That's a signed int though...