Here's a possibility.  Not very elegant, but it works.
Replace the list and the numberboxes with whatever input and output you need and it ought to work, if the differences are smaller than 100000.
-Chuckk

On 6/18/07, danja <binary.koala@gmail.com> wrote:
hello there,
i have a [list] of numbers and i'd like to search through it for the
value closest to the search subject. so to say, if i have '22 31 47 86'
in my list and i match it with '45' the answer would be '47' (closest in
the list). this rather useful function (fuzzy integer search?) must have
been written by someone already, it's just that i can't find it :)
i wouldn't ask if i could patch it myself, but i know how it might work:
all integers from the list are compared to the reference (subject)
number, and the integer in subtraction closest to '0' would be the
hit... you know what i mean?

any advice is very much appreciated!

p.s. apologies for my ignorance, i'm just starting here...

--
danja
http://k0a1a.net

_______________________________________________
PD-list@iem.at mailing list
UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list



--
http://www.badmuthahubbard.com