News for hackers. Stuff that matters.
Re:Fast midpoint between two integers without overflow by brudgers on Wednesday December 07, 2022 @12:16PM (#33897061)
It's the kind of edge case I know because I just read the article...and it's probably bad if you've been bitten and that bite is still driving how you handle this case.

Because while it is easy to be bitten by this on at 16 or 32 bits, if it happens at 64 bits (1.8446744e+19) it's almost certainly an abstraction error like arithmetic on identifiers rather than values.

Back around 2010, I wrote some code for the first time in a very long time and that code initialized a 10,000 integer array and my first thought was "that's too big to work." Kilobyte thinking in a gigabyte future.

To a first approximation, as an interview question it fights the last war...again embedded systems excepted.

There are no comments on this comment yet.