Convergence using find?

Dar Scott dsc at swcp.com
Wed Apr 7 17:21:21 EDT 2004


On Wednesday, April 7, 2004, at 02:47 PM, Glen Bojsza wrote:

> I was wondering if anyone has suggestions for converging to the 
> nearest number ( if the desired number doesn't exist) in a sorted 
> field?

(In my earlier comment, I didn't notice this was already sorted.)

I change my mind.  It might be best to do a brute-force linear search 
for best.

Assume the first one is the best so far.  Use 'repeat for each line L 
in'.  For each line, check to see if it is better.  If it is, make that 
one the best so far.  After the loop, you will have the best.

The other method is better for constant time nth-thing access or split 
and might not be good for lines.

Dar Scott



More information about the use-livecode mailing list