this post was submitted on 12 Mar 2025
148 points (98.1% liked)

xkcd

9943 readers
138 users here now

A community for a webcomic of romance, sarcasm, math, and language.

founded 2 years ago
MODERATORS
 

It does come at the small cost of a LOT more off-by-40-or-50 errors.

https://explainxkcd.com/3062/

top 5 comments
sorted by: hot top controversial new old

Welp, guess it's time for:

for(float i = 0.0; ....) {...}

[–] mr_pip@discuss.tchncs.de 1 points 6 days ago

but therewill be occurences when you add/subtract the same number when writing and reading an int, so it is not entirely eliminated

[–] coldsideofyourpillow@lemmy.cafe 15 points 1 week ago (1 children)

wait, but what about off-by-39-or-51 errors?

[–] VindictiveJudge@lemmy.world 1 points 6 days ago

And the off-by-41-or-49 errors.

[–] Zaktor@sopuli.xyz 6 points 1 week ago

In this language you would account for this behavior so all comparisons and lookups would be designed to be valid for the increased range. To do this you'd have to record integers in increments of 10, so there would be no (or very few) off-by-40-to-50 errors, or off-by-1 errors, but there would be off-by-10 errors.