def _getSmallestDifference(inputList, targetVal):
    """
    Returns the value in inputList that is closest to targetVal
    
    Iteratively splits the dataset in two, so it should be pretty fast
    """
    targetList = inputList[:]
    retVal = None
    while True:
        if len(targetList) == 1:
            retVal = targetList[0]
            break
        halfPoint = int(len(targetList) / 2.0) - 1
        a = targetList[halfPoint]
        b = targetList[halfPoint + 1]
        leftDiff = abs(targetVal - a)
        rightDiff = abs(targetVal - b)
        if leftDiff == 0 or rightDiff == 0:
            retVal = targetVal
            break
        if leftDiff < rightDiff:
            targetList = targetList[:halfPoint + 1]
        else:
            targetList = targetList[halfPoint + 1:]
    return retVal
