Subj : Re: resolving a list of numbers to a range To : comp.programming From : Espen Suenson Date : Fri Aug 19 2005 02:49 pm Scott Moore wrote: > placid wrote: >> Hi all, >> >> I was just if anyone knows a way to resolve a list of integers say >> {1,2,3,4,5} into a range that is 1-5? >> > > Humm. I note that your question has caused most people here to assume > that the list had no gaps, because your example had no gaps. If your > list can have gaps, then the answer is completely different, > i.e., (1, 2, 3, 5, 6, 7) becomes 1-3, 5-7. Not if you're content with just one range as an answer. (1, 2, 3, 5, 6, 7) all lie in the range 1-7. Anyway, the OP was rather vague. Espen -- Numbers are the free creation of the human mind. Julius Wilhelm Richard Dedekind .