Re: Float comparison



Keith Thompson wrote:

.... snip ...

A stored value of type double cannot represent the real value
1.0+DBL_EPSILON/2.0, any more than a stored value of type int
can represent the value 1.5.

So what? doubles are used to store reals, more or less. ints are
used to store integers. 1.0+DBL_EPSILON/2.0 is a real[1]. 1.5 is
NOT an integer.

[1] but not a storable real, in a double.

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.


.



Relevant Pages

  • Re: on-line calculator
    ... so, by containment: ... extension of the reals. ...
    (sci.math)
  • Re: Float comparison
    ... of their own which just happens to be a subset of the reals. ... they must be ranges of reals. ... This means that even if you ignore the limited range floating point types would still not be a group under addition. ...
    (comp.lang.c)
  • Re: .9 repeating
    ... other real number except zero. ... There is no gap between the reals and the rationals. ... I didn't invent h, Bonehead, ...
    (sci.physics.relativity)
  • Re: Non-Standard Analysis & Other Infinities
    ... countable number of steps the degenerate "closed interval" containing ... Continuum Hypothesis. ... possible reals. ...
    (sci.math)
  • Re: Float comparison
    ... snip ... ... which when converted to floating point type results in the same ... Only Keith's had the unique property of ... exact equality in the reals. ...
    (comp.lang.c)