I came across this question while looking for Amazon interview questions and wanted to ask.
Given a number, how can you find the closest number in a series of floating point data?
If everything is integer , answer is substracting the number from every number in the array, then look for the element with minimum absolute value in the array.
But when it comes to floating points, it should be highly nontirival.
Ani ideas?? Thanks.