From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,9b4538cfeb0c3576 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!i24g2000yqa.googlegroups.com!not-for-mail From: Shark8 Newsgroups: comp.lang.ada Subject: Re: Float conversion Date: Sat, 7 Aug 2010 06:49:17 -0700 (PDT) Organization: http://groups.google.com Message-ID: <4a3f1c7a-4cc6-4cc1-9ab7-e9c5613cedcb@i24g2000yqa.googlegroups.com> References: <9e669a3b-1013-4bd1-b372-5f7dfa46d083@f42g2000yqn.googlegroups.com> <1q5zc0ais535h$.1jqwfxhj9cflc$.dlg@40tude.net> <4c519968$0$6893$9b4e6d93@newsspool2.arcor-online.net> <1d1txn4x3r5xn.1trm4gx9n87gm$.dlg@40tude.net> <1jo4xj7cntwy1$.1ntf9smcka8vf$.dlg@40tude.net> <1d617940-d138-4b8c-a321-ed23b47431b8@x21g2000yqa.googlegroups.com> <1naf3ekl5k916$.f7ugc92galdz$.dlg@40tude.net> <82y6cru1lp.fsf@stephe-leake.org> <77ee8883-ab9f-42c7-94d5-3d85cdc19693@i28g2000yqa.googlegroups.com> <82pqxyu9bw.fsf@stephe-leake.org> <82vd7ps1sc.fsf@stephe-leake.org> <4c5d1fbd$0$7666$9b4e6d93@newsspool1.arcor-online.net> NNTP-Posting-Host: 174.28.246.148 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1281188970 27372 127.0.0.1 (7 Aug 2010 13:49:30 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 7 Aug 2010 13:49:30 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: i24g2000yqa.googlegroups.com; posting-host=174.28.246.148; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8 ( .NET CLR 3.5.30729; .NET CLR 4.0.20506),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:12931 Date: 2010-08-07T06:49:17-07:00 List-Id: On Aug 7, 2:56=A0am, Georg Bauhaus wrote: > On 8/7/10 7:54 AM, Shark8 wrote: > > > Function Min( A, B, C : SOME_TYPE ) is > > begin > > If A< =A0B AND A< =A0C then > > =A0 =A0 return A; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0-- We know A is the sm= allest valued var > > here... > > elsif B< =A0C then =A0 =A0 =A0 =A0 =A0 =A0-- and in the ELSE case we kn= ow that it is > > not the smallest value. > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0-- If A is e= qual to C or B then returning > > that value is equivalent to returning A's value. > > =A0 =A0 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.