Passer au contenu principal
Bluvy Tube
Appuyez sur Échap pour quitter le plein écran
Volume m
/
i
Mode Cinéma 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. 🧵

Raccourcis clavier

Espace K
Lecture / pause
← →
Reculer / avancer de 5 s
J L
Reculer / avancer de 10 s
0–9
Aller à 0 %–90 % de la vidéo
Home End
Début / fin
, .
Image précédente / suivante (en pause)
< >
Ralentir / accélérer
↑ ↓
Volume
M
Couper / rétablir le son
C
Sous-titres
F
Plein écran
I
Image dans l’image
T
Mode cinéma
?
Afficher cette aide

🤯 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

S'abonner
0 vue Publié le 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 commentaire
?
🧪 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.
Voir le post d'origine sur Bluesky
Lien copié dans le presse-papier

Connexion

Il est temps de faire une pause

Ça fait 30 minutes que vous enchaînez les vidéos : accordez-vous 5 minutes loin de l'écran. Levez-vous, étirez-vous, buvez un verre d'eau… Les vidéos vous attendront ici.