How to find a closest entry in an array using system verilog

In reply to uvm_va_1:

Did you try it?