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-7-bit Path: g2news1.google.com!postnews.google.com!5g2000yqz.googlegroups.com!not-for-mail From: Shark8 Newsgroups: comp.lang.ada Subject: Re: Float conversion Date: Fri, 6 Aug 2010 22:54:07 -0700 (PDT) Organization: http://groups.google.com Message-ID: 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> NNTP-Posting-Host: 174.28.246.148 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1281160447 24882 127.0.0.1 (7 Aug 2010 05:54:07 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 7 Aug 2010 05:54:07 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: 5g2000yqz.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:12921 Date: 2010-08-06T22:54:07-07:00 List-Id: > I don't understand that. Phil Clayton's example was: > if A < B and A < C > then > Y := A; > elsif B < C and B < A > then > Y := B; > else > Y := C; > end if; > (Interesting example, by the way!) This could be written better as: 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; else -- We know here that C is the low-valued parameter. return C; end Min; You could also add the Pragma 'inline' if you wanted.