Skip to main content
Bluvy Tube
Press Esc to exit fullscreen
Volume m
/
i
Theater mode t
f
/
🤯 204 + 102 / 2 = 255 in Swift. And it's a bug. ➗ Division binds tighter than +, so Swift computes 204 + 51. ✅ The average you wanted: (204 + 102) / 2 = 153. 🔇 No error. No warning. It just looks reasonable. 🧮 Bonus trap: integer division drops the remainder. 255 / 2 = 127 → 7F, not 80. 🧵

Keyboard shortcuts

Space K
Play / pause
← →
Back / forward 5 s
J L
Back / forward 10 s
0–9
Jump to 0%–90% of the video
Home End
Start / end
, .
Previous / next frame (while paused)
< >
Slower / faster
↑ ↓
Volume
M
Mute / unmute
C
Captions
F
Fullscreen
I
Picture-in-picture
T
Theater mode
?
Show this help

🤯 204 + 102 / 2 = 255 in Swift. And it's a bug. ➗ Division binds tighter than +, so Swift computes 204 + 51. ✅ The average you wanted: (204 + 102) / 2 = 153. 🔇 No error. No warning. It just looks reasonable. 🧮 Bonus trap: integer division drops the remainder. 255 / 2 = 127 → 7F, not 80. 🧵

Cane Allesta

Cane Allesta

@caneallesta.bsky.social

Subscribe
0 views Published on 23/11/2026 03:58 1:11
🤯 204 + 102 / 2 = 255 in Swift. And it's a bug. ➗ Division binds tighter than +, so Swift computes 204 + 51. ✅ The average you wanted: (204 + 102) / 2 = 153. 🔇 No error. No warning. It just looks reasonable. 🧮 Bonus trap: integer division drops the remainder. 255 / 2 = 127 → 7F, not 80. 🧵
1 comment
?
🧪 Sanity check that catches both: average a value with itself. Same value back, or it's broken.

🎯 Rule: parentheses aren't decoration. Write the grouping you mean.
View original post on Bluesky
Link copied to clipboard

Sign in

Time to take a break

You've been watching videos for 30 minutes straight: give yourself 5 minutes away from the screen. Stand up, stretch, grab a glass of water… Your videos will be right here when you're back.