Here's a possibility. Not very elegant, but it works.<br>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.<br>-Chuckk<br><br>
<div><span class="gmail_quote">On 6/18/07, <b class="gmail_sendername">danja</b> <<a href="mailto:binary.koala@gmail.com">binary.koala@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
hello there,<br>i have a [list] of numbers and i'd like to search through it for the<br>value closest to the search subject. so to say, if i have '22 31 47 86'<br>in my list and i match it with '45' the answer would be '47' (closest in
<br>the list). this rather useful function (fuzzy integer search?) must have<br>been written by someone already, it's just that i can't find it :)<br>i wouldn't ask if i could patch it myself, but i know how it might work:
<br>all integers from the list are compared to the reference (subject)<br>number, and the integer in subtraction closest to '0' would be the<br>hit... you know what i mean?<br><br>any advice is very much appreciated!
<br><br>p.s. apologies for my ignorance, i'm just starting here...<br><br>--<br>danja<br><a href="http://k0a1a.net">http://k0a1a.net</a><br><br>_______________________________________________<br><a href="mailto:PD-list@iem.at">
PD-list@iem.at</a> mailing list<br>UNSUBSCRIBE and account-management -> <a href="http://lists.puredata.info/listinfo/pd-list">http://lists.puredata.info/listinfo/pd-list</a><br></blockquote></div><br><br clear="all"><br>
-- <br><a href="http://www.badmuthahubbard.com">http://www.badmuthahubbard.com</a>