I'm working on a little Harbour program where my algorithm has to
decide on the nearness of n sets of numbers. There are two integers
in each set. I retain a measurement of of each set :
Here is the algo I am using to compute and save the 'nearness' of each set:
nVal := ABS(log(a)-log(b))
where a and b are the two numbers in each set. (Typical values of a
and b will range up in the trillions.) I will save/compare this nVal with many thousands of other nVals and decide with nVal is the smallest
value, and so which set is 'nearest'.
I don't expect a and b to ever be identical, but, if they are, I would be delighted. But, first, I wish to find the nearest.
Question: Is there a better algo that you know off than the one I show
above. ??
Hi David:
Thanks for your alternate solutions. I will test and consider them.
I've been looking at 'nearness' for a couple of days now, and there seem to be several different thoughts/ways to measure.
-Mel
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 144 |
Nodes: | 16 (1 / 15) |
Uptime: | 70:42:55 |
Calls: | 2,996 |
Files: | 10,063 |
Messages: | 2,701,656 |