this post was submitted on 09 Aug 2024
1340 points (98.1% liked)

Programmer Humor

19503 readers
339 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 6 points 3 months ago* (last edited 3 months ago) (1 children)

Ninety-nine billion, nine hundred ninety-nine million, nine hundred ninety-nine thousand nine hundred ninety-nine bottles of beer on the wall,

Ninety-nine billion, nine hundred ninety-nine million, nine hundred ninety-nine thousand nine hundred ninety-nine bottles of beer,

You take one down, pass it around,

Ninety-nine billion, nine hundred ninety-nine million, nine hundred ninety-nine thousand nine hundred ninety-eight bottles of beer on the wall.

[–] [email protected] 3 points 3 months ago (1 children)

Unfortunately the bar was built on long int so it overflowed 23 times and landed on about 1.2 billion.

One billion, two-hundred fifteen million, seven-hundred fifty-two thousand, two-hundred-something bottles of beer on the wall, one billion, two-hundred fifteen million, seven-hundred fifty-two thousand, two-hundred-something bottles of beer! Take one down, pass it around...

One less bottle of beer on the wall :)

[–] [email protected] 1 points 3 months ago* (last edited 3 months ago) (1 children)

I wonder what would happen if it was a singed long, and it landed somewhere in the negatives after overflowing multiple times?

Negative forty-eight thousand, six hundred thirty-three bottles of beer on the wall,

Negative forty-eight thousand, six hundred thirty-three bottles of beer

You take one down, pass it around,

Negative forty-eight thousand, six hundred thirty-four bottles of beer on the wall

[–] [email protected] 1 points 3 months ago (1 children)

Well, silly me, I should have specified that I did my calculation with signed long, though it shouldn't affect the outcome much given my rounding at the hundreds.

I like the idea of beer debt to the wall, though!

[–] [email protected] 1 points 3 months ago

I once wrote a Python script that implemented this song, I could probably abuse that old program to make this nonsense happen.