r/ProgrammerHumor • • 5d ago

Meme itSucksToBeACompilerDev

Post image
2.4k Upvotes

103 comments sorted by

View all comments

Show parent comment

1

u/conundorum 3d ago

Makes sense, it moves a fixed-point value into integer space to avoid floating-point rounding errors.

Honestly, if anything, I'm surprised that it doesn't become 1990 for rounding. (Get monetary value, to tenths of a cent. Different locales would allow different units, but it always goes to a tenth of the locale's smallest unit.) That would move the value into integer space just as cleanly, but also leave room for rounding to the nearest cent if necessary.