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 Path: g2news1.google.com!postnews.google.com!t2g2000yqe.googlegroups.com!not-for-mail From: Phil Clayton Newsgroups: comp.lang.ada Subject: Re: Float conversion Date: Wed, 4 Aug 2010 09:32:21 -0700 (PDT) Organization: http://groups.google.com Message-ID: <574794e0-48c5-4139-86ed-b72996839f82@t2g2000yqe.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> <4c57f1b1$0$7661$9b4e6d93@newsspool1.arcor-online.net> NNTP-Posting-Host: 89.195.10.199 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1280939542 16020 127.0.0.1 (4 Aug 2010 16:32:22 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 4 Aug 2010 16:32:22 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: t2g2000yqe.googlegroups.com; posting-host=89.195.10.199; posting-account=v7gx3AoAAABfjb9m5b7l_Lt2KVEgQBIe User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.9.0.15) Gecko/2009102704 Fedora/3.0.15-1.fc10 Firefox/3.0.15,gzip(gfe) Xref: g2news1.google.com comp.lang.ada:12855 Date: 2010-08-04T09:32:21-07:00 List-Id: On Aug 3, 11:38=A0am, Georg Bauhaus wrote: > On 03.08.10 03:07, Phil Clayton wrote: > > >> Clearly to cover all cases, you > >> need A < B, A =3D B, A > B, A < C, etc. > > > You make it sound easy... =A0Generally, 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 "<", "=3D", and ">" > won't tell the whole story in any case? (If they are assumed > to mean what they usually mean in "mathematics".) Yes. Using a mathematical model where floating point values are viewed as mathematical real numbers (i.e. having infinite precision) and where operators have their standard mathematical meaning is an approximation. Reasoning with such a model of programs will detect a useful and wide class of error but won't correctly predict the behaviour of programs in absolutely every case. It is easy to produce examples that demonstrate this involving floating point equality and values that cannot be represented exactly. Phil