A faster way to calculate the day-of-the-week

https://www.benjoffe.com/fast-day-of-week

89 points · 11 comments · view on lemmy.world

11 Comments

aichan@piefed.blahaj.zone · 30 pts · 11d

By the end, you will understand why this code above works.

I was utterly fooled. Looks cool though!

Shin@piefed.social · 9 pts · 11d

This is a freaking good read.

tracyspcy@lemmy.ml · 5 pts · 11d (2 replies)

Bookmarked to read later. Looks interesting from first sight

lauha@lemmy.world · 19 pts · 11d (1 reply)

If I had a nickle for every time I bookmarked to read later and never did...

IntroSkeptic@lemmy.blahaj.zone · 1 pts · 8d

Your bookmarks must be very interesting... Mind sharing for those of us that are absolute reading whores? (´・ω・`)

somegeek@programming.dev · 3 pts · 10d

How do you make these types of interactive websites? (the visualizations changing for different codes)

underscores@lemmy.zip · 2 pts · 11d (4 replies)

What does two's complement mean ? I don't want a comp sci definition per se but like language one, how does saying that make sense ?

deepfriedchril@lemmy.world · 8 pts · 11d (3 replies)

It's how you change a number to/from positive/negative.

The basic procedure is to represent the number in binary, invert all the bits, add 1.

underscores@lemmy.zip · 3 pts · 10d (2 replies)

How does that relate to the word "complement"

Starfighter@discuss.tchncs.de · 16 pts · 10d (1 reply)

The same how a complementary color is the "opposite" color on the color circle. You invert all the bits to go around the number space circle (mathematically called a "field"). Opposed to normal number spaces this one is a circle since overflowing a binary number (ie all bits being 1 and adding one) will reset you back to 0.

underscores@lemmy.zip · 7 pts · 10d

Thanks. that's the answer I was looking for