Fixed calculation of interpolated value at upper limit

A typo caused incorrect results for interpolated values at or beyond the
upper limit of the interpolation range. The unit tests were adjusted to
reflect this fix.