OK, how would I figure out the midpoint of two segments? For example, it's pretty easy to deduce on $\displaystyle segment\ AB$ if A= 40 and B = 80, the midpoint is 60 but how would I do it for more difficult numbers?

The best solution I could come up with is literally witting out every number and counting towards the middle, even though I know it invites accidents and simple (in a bad way). Any suggestions?