Get the closest value to number
Pyth, 6 bytes

haDQSE


Test suite

Input in the following form on STDIN:

num
array


Explanation:

haDQSE
          Implicit: Q = eval(input()) (num)
     E    Evaluate input (array)
    S     Sort (smaller values to the front)
 aDQ      Sort by absolute difference with Q.
h         Take the first element of the sorted list, the min.
          Print implicitly.