Added clip function for scalar values.  np.clip would work but is inteaded
for use on arrays, and using %timeit in ipython shows it as about 
15-20 times slower when just working with a scalar.