Re: Float comparison
- From: CBFalconer <cbfalconer@xxxxxxxxx>
- Date: Mon, 04 May 2009 20:54:35 -0400
Keith Thompson wrote:
gordonb.rhrsn@xxxxxxxxxxx (Gordon Burditt) writes:.... snip ...
Physics also emphasizes that measurements are inherently inaccurate,
especially when using instruments cheap enough they'll let YOU use
them. Early on you learn that "95.000 inches" implies much greater
measurement accuracy than "95.0 inches", whether you get that
measurement anywhere near a computer or calculator or not.
[snip]
We weren't talking about measurements. We were talking about stored
floating-point values. For example, 95.0 and 95.000 are exactly the
same value in C, and may or may not be the result of any measurement.
A given stored floating-point value might have some error range
associated with it, but the floating-point types themselves are
not capable of representing such an error range.
Right there is our fundamental disagreement. FP objects can only
store discrete values, with defined intervals between the available
values. Thus you can never tell which value in that range was
stored, without detailed knowledge of the associated code. The
ranges are inherent in the storage mechanism, and their sizes are
represented by the various x_EPSILON values.
--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.
.
- Follow-Ups:
- Re: Float comparison
- From: Richard Heathfield
- Re: Float comparison
- From: Richard Heathfield
- Re: Float comparison
- From: Keith Thompson
- Re: Float comparison
- References:
- Re: Float comparison
- From: *** T. Winter
- Re: Float comparison
- From: Gordon Burditt
- Re: Float comparison
- From: Keith Thompson
- Re: Float comparison
- Prev by Date: Re: comare tow int
- Next by Date: Re: comare tow int
- Previous by thread: Re: Float comparison
- Next by thread: Re: Float comparison
- Index(es):