comp.lang.ada
 help / color / mirror / Atom feed
From: Shark8 <onewingedshark@gmail.com>
Subject: Re: Float conversion
Date: Sat, 7 Aug 2010 06:49:17 -0700 (PDT)
Date: 2010-08-07T06:49:17-07:00	[thread overview]
Message-ID: <4a3f1c7a-4cc6-4cc1-9ab7-e9c5613cedcb@i24g2000yqa.googlegroups.com> (raw)
In-Reply-To: 4c5d1fbd$0$7666$9b4e6d93@newsspool1.arcor-online.net

On Aug 7, 2:56 am, Georg Bauhaus <rm-host.bauh...@maps.futureapps.de>
wrote:
> On 8/7/10 7:54 AM, Shark8 wrote:
>
> > Function Min( A, B, C : SOME_TYPE ) is
> > begin
> > If A<  B AND A<  C then
> >     return A;                -- We know A is the smallest valued var
> > here...
> > elsif B<  C then            -- and in the ELSE case we know that it is
> > not the smallest value.
> >                              -- If A is equal to C or B then returning
> > that value is equivalent to returning A's value.
> >     return B;
>
> Generalizing, when Min returns not the values but identities,
> will the equivalence of A and B work when stable sorting is needed?
>
> Another question, are there algorithms that rely on
> the representation of A, B, and C so that equivalence
> doesn't establish equality?
>
> Georg

Good questions.
In regard to the stability, I'm under the impression that is a
property of the algorithm rather than the comparative-operation.
{For example Shell sort is NOT a "stable" sot, but it uses the same
operator that merge sort uses; merge sort *is* stable.}

For the equivalence/equality question I think it's a matter of the
data-type rather than the algorithm that determines it. For example we
could define a Set Type with the operation "<" returning true if Left
is a proper/strict subset of Right (that is to say fully contained by
the superset and NOT equal to it). Now, given a set [Red, Blue, Green,
Purple, Yellow, Gray] both [Red,Green,Blue] & [Red, Yellow, Blue] are
subsets thereof and return true for "<". However, neither of the
subsets are equal or subsets of one another; so we cannot use "<"
alone to determine how to 'sort' this group of sets.



  reply	other threads:[~2010-08-07 13:49 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-29 12:23 Float conversion Henrique
2010-07-29 12:44 ` Jacob Sparre Andersen
2010-07-29 12:46 ` Dmitry A. Kazakov
2010-07-29 15:08   ` Georg Bauhaus
2010-07-29 15:10     ` Georg Bauhaus
2010-07-29 15:35     ` Dmitry A. Kazakov
2010-07-29 18:21       ` Henrique
2010-07-29 19:08         ` Jeffrey R. Carter
2010-07-29 19:15         ` Dmitry A. Kazakov
2010-07-30  1:30           ` Phil Clayton
2010-07-30  8:43             ` Dmitry A. Kazakov
2010-07-30 13:14               ` Phil Clayton
2010-07-30 14:34                 ` Dmitry A. Kazakov
2010-07-31 15:12                 ` Stephen Leake
2010-08-03  1:07                   ` Phil Clayton
2010-08-03  3:31                     ` Shark8
2010-08-03 10:38                     ` Georg Bauhaus
2010-08-04  7:27                       ` Stephen Leake
2010-08-04 16:15                         ` Georg Bauhaus
2010-08-04 16:32                       ` Phil Clayton
2010-08-04  7:26                     ` Stephen Leake
2010-08-04 12:52                       ` Robert A Duff
2010-08-04 14:32                         ` Dmitry A. Kazakov
2010-08-04 19:36                           ` Simon Wright
2010-08-04 19:46                             ` Dmitry A. Kazakov
2010-08-04 20:29                             ` Georg Bauhaus
2010-08-05 12:05                         ` Stephen Leake
2010-08-07  5:54                           ` Shark8
2010-08-07  8:56                             ` Georg Bauhaus
2010-08-07 13:49                               ` Shark8 [this message]
2010-08-05 10:20                       ` Phil Clayton
2010-07-30 13:16           ` Henrique
2010-07-29 15:37   ` Warren
2010-07-29 14:56 ` Georg Bauhaus
2010-07-29 17:56   ` Jeffrey R. Carter
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox