comp.lang.ada
 help / color / mirror / Atom feed
From: Phil Clayton <phil.clayton@lineone.net>
Subject: Re: Float conversion
Date: Wed, 4 Aug 2010 09:32:21 -0700 (PDT)
Date: 2010-08-04T09:32:21-07:00	[thread overview]
Message-ID: <574794e0-48c5-4139-86ed-b72996839f82@t2g2000yqe.googlegroups.com> (raw)
In-Reply-To: 4c57f1b1$0$7661$9b4e6d93@newsspool1.arcor-online.net

On Aug 3, 11:38 am, Georg Bauhaus <rm.dash-bauh...@futureapps.de>
wrote:
> 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? (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



  parent reply	other threads:[~2010-08-04 16:32 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 [this message]
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
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