i am having one collection . The collection is below
X=[1940,1941,1943,1945,1978]
i want to find the nearest values from the above collection by passing some value (ex:1944.578895)
for 1944.57889
it will return 1945
and for 1943.5
it will return 1943
like that. the collection "X
" will be varied that means it contains floating numbers too.
so i want to find the nearest value for floating point collection as well numeric collection.
Thanks,
Siva