Hacker News new | ask | show | jobs
by nostromo 4995 days ago
4.5 is halfway between 0 and 9. Halfway between 1 and 9 is 1+(9-1)/2 = 5
1 comments

Nu-uh. By that math, halfway between 1 and 2 is.... 1?!

  1+(2-1)/2
  1+(1)/2
  1.5
It only equals 1 if you are using ints ;) I do that more often than I care to admit, I blame programming.
his formula is correct. you made a mistake in the order of operations.