Re: Float comparison
- From: CBFalconer <cbfalconer@xxxxxxxxx>
- Date: Fri, 08 May 2009 18:56:56 -0400
Keith Thompson wrote:
CBFalconer <cbfalconer@xxxxxxxxx> writes:
[...]
True, but we are talking about FP representation (and int
representation), which have other limitations, including maximum
and minimum values. ints don't have a range associated with each
value, the adjacent integer value is always available. Reals don't
have an adjacent value, but rationals do (they are countable). The
FP system is built on rationals, but cannot express the adjacent
rational. Neither the integer nor the FP system can handle the
infinities that exist in arithmetic.
Yes, rationals are countable, but no, they do not have adjacent
values. Given any two rational numbers x and y, the rational number
(x+y)/2 is between them and distinct from both of them. (I'm
referring to mathematical rational numbers here, not to any C
representation of them.)
True. My interchanging of 'countable' and ordering is not valid.
However floating-point types do have adjacent values. For example,
1.0 and 1.0+DBL_EPSILON are adjacent values of type double; there
are no double values between them.
True again. Now all I want is for people to keep that (and the
consequences) in mind.
--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.
.
- Follow-Ups:
- Re: Float comparison
- From: Keith Thompson
- Re: Float comparison
- References:
- Re: Float comparison
- From: David Thompson
- Re: Float comparison
- From: CBFalconer
- Re: Float comparison
- From: Keith Thompson
- Re: Float comparison
- Prev by Date: Re: Float comparison
- Next by Date: Re: Float comparison
- Previous by thread: Re: Float comparison
- Next by thread: Re: Float comparison
- Index(es):
Relevant Pages
|