B-TIER art
Genie integer overflow — wishing for negative wishes
100k ft — What is this?
Genie integer overflow — wishing for negative wishes
50k ft — Why care?
2D animated skit where a user exploits a genie's 2-bit wish counter: wishing for negative wishes should underflow to the maximum value, so he first upgrades the data type to 64 bits and ends with ~18 quintillion wishes. A fun explainer of integer overflow.
10k ft — Key takeaways
• An unsigned 64-bit max is about 1.8×10^19
• Underflow wraps to the type's maximum value
5k ft — Tools & techniques
(no tools tagged)
integer overflow
1k ft — Deep-dive / try it
Can i wish fir less wishes 😂
#anime #relatable #animation2d #fyp #relationships
Transcript excerpt
What's up, dude? I'm your genie, you know the rules, can't wish for love, death, more wishes. You can wish for death if you really want to, like I'm chill with it, but other than that, go wild. Can I wish for less wishes? I guess, yeah, you can wish for less wishes, like an idiot. Oh, but I'm not an idiot, because surely the wish servers weren't designed to hold negative numbers of wishes, because who would wish for negative wishes? So if I start with three wishes and then I wish for negative three wishes, the act of wishing will bring me down to two wishes, and the wish itself will bring me down to negative one, thus causing an overflow error in the wish circles bringing me up to the highest possible integer value of wishes available by the datatype. Uh, yeah, maybe, man, I don't know, I don't work server-side development, I'm just, I'm just customer service. I wish for negative three wishes added to my total number of wishes after I make this wish and then brought down to two wishes. Oh, that's complicated wording, I guess you know how the genie shit works, okay. Uh, that, you've got three wishes still. Still just three, oh my god, it's a two-bit datatype. I don't know what that means, but it's really cool that you made a wish that did nothing, I've never seen that before. Okay, I wish for the datatype that holds the number of wishes a person can have to be updated from two bits to like, I don't know, 64. Uh, sounds like my bosses are gonna have to create a new rule, but…