Expose "nearest" in a better way
log is not used, raise an exception instead