Path: csiph.com!news.mixmin.net!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: Tim Rentsch
Newsgroups: comp.lang.c
Subject: Re: Compute Unique Numbers in a Set
Date: Mon, 02 Jan 2023 20:52:02 -0800
Organization: A noiseless patient Spider
Lines: 40
Message-ID: <86k024p6dp.fsf@linuxsc.com>
References: <87358sq1w7.fsf@bsb.me.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: reader01.eternal-september.org; posting-host="cadf8b4f887ed22a851b24e8b9807b6b"; logging-data="2163297"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Cbw1RXx3ushQ9JxxNi5IAQ9M0qjV/fgA="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:/kTkMaBJT1kP9DuyiHvaCcfzHY8= sha1:IiPNuPzKKsIzM0hEtSZ88PphjDQ=
Xref: csiph.com comp.lang.c:168715
Ben Bacarisse writes:
> Richard Damon writes:
>
>> On 1/2/23 10:22 AM, Stefan Ram wrote:
>>
>>> Albert writes:
>>>
>>>> Subject: Compute Unique Numbers in a Set
>>>
>>> In a set, every number is unique.
It seems likely that OP was speaking informally. Probably he
meant some sort of generic collection rather than specifically a
mathematical set.
>> Assuming you are using the right Technical definition of Set.
>
> I suspect there's a language problem here. Without thinking much about
> it assumed the result was to be a set (as you know) but I now think the
> OP probably meant "compute (i.e choose) unique numbers /from/ a set".
> The term "in a set" makes no literal sense and, as noted, clashes with
> unique. But someone might write "in a set" by analogy with mathematical
> phrases like, "compute the roots in R".
The original posting said
Is this the best way to generate unique random numbers
in a set of 6 numbers?
which reinforces my view that OP meant something like collection
rather than something having to do with set as the term is used
in mathematics.
I confess I paid more attention to the code than to how the
question was asked. As a result of that, the comments I gave
assumed that the ordering of the six numbers was relevant.
However, looking back on it now, if I had to bet my bet would
be that OP doesn't care about the order, but just wants six
unique numbers (chosen from the relevant range).