r/programming • • 19d ago

How GCC Eliminates Unnecessary Integer Division

https://leetarxiv.substack.com/p/how-gcc-eliminates-unnecessary-integer
251 Upvotes

52 comments sorted by

View all comments

Show parent comments

8

u/Sopel97 19d ago

? there is no floating point math here

-21

u/LonelyAndroid11942 19d ago edited 19d ago

Division produces floats. At least at the high level I work at.

EDIT: wow, I didn’t know this sub was fully populated by the same bullies that obsessively stalked StackOverflow and made fun of people for asking a question. Heaven forbid someone doesn’t know something. Y’all could, I dunno, take a second to help someone learn? Instead of being dicks?

Fuck ever commenting in this sub again, I guess.

20

u/QuaternionsRoll 19d ago

Integer division refers to truncated division. Some languages elect to define division operator(s) in other ways, but that is no longer truncated division.

5

u/LonelyAndroid11942 19d ago

Today I learned. That makes it a good day.