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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham 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!news4.google.com!feeder2.cambriumusenet.nl!feeder3.cambriumusenet.nl!feed.tweaknews.nl!193.141.40.65.MISMATCH!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Wed, 04 Aug 2010 18:15:36 +0200 From: Georg Bauhaus User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.7) Gecko/20100713 Thunderbird/3.1.1 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Float conversion 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> <4c57f1b1$0$7661$9b4e6d93@newsspool1.arcor-online.net> <82lj8mu9ar.fsf@stephe-leake.org> In-Reply-To: <82lj8mu9ar.fsf@stephe-leake.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-ID: <4c599229$0$6761$9b4e6d93@newsspool3.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 04 Aug 2010 18:15:37 CEST NNTP-Posting-Host: 44f3cd3e.newsspool3.arcor-online.net X-Trace: DXC=Y_>MVEY9h2HlU`@c^jLCbJMcF=Q^Z^V3H4Fo<]lROoRA8kFJLh>_cHTX3jM60ke81\eOUK X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:12854 Date: 2010-08-04T18:15:37+02:00 List-Id: On 04.08.10 09:27, Stephen Leake wrote: > Georg Bauhaus writes: > >> On 03.08.10 03:07, Phil Clayton wrote: >> >>>> Clearly to cover all cases, you >>>> need A < B, A = B, A > B, A < C, etc. >>> >>> You make it sound easy... Generally, how do you justify that tests >>> 'cover all cases' so giving you a 100% chance of finding an error? >> >> When {A, B, C} in (machine) Float, I guess "<", "=", and ">" >> won't tell the whole story in any case? > > Why not? > > Those are the only conditions tested in the code. Suppose the code has, for a reason, the conditional if A = A then else end if; That one can be important, J.-P. Rosen recently explained why, talking about NaN. Is this test usually present? Then, as Dmitry said, comparing Inf needs special care. The meaning of predefined "=" in some test case, for some floating point type, can depend not just on platform, but also on platform state. Practically, GNAT has, or used to have a state switching subprogram that would turn on 80 bit FPT when running on Windows NT, IIRC. Can a test make sure that results of "=" or even of "<" will be unaffected by state switches in the processor? What if significant epsilons change as computed results grow or shrink? Additionally, can one write a test for ARM Something and hope it gives the same result on a PC workstation for the "same" program? Georg