Comment

Comment by dskloet

It's not the same. With integer division you know the division rounds down, so using <= always splits between the two points.

That said, it's always safer to compute the mean of two integers as

min + (max - min) / 2

to avoid integer overflow.

parent dskloet 10 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton