Re: Float comparison
- From: CBFalconer <cbfalconer@xxxxxxxxx>
- Date: Fri, 08 May 2009 21:36:44 -0400
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.
.
- 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
- From: CBFalconer
- Re: Float comparison
- From: Keith Thompson
- Re: Float comparison
- Prev by Date: Re: Float comparison
- Next by Date: Re: looking for thoughts on the philosophy of optimizing compilers
- Previous by thread: Re: Float comparison
- Next by thread: Re: Float comparison
- Index(es):
Relevant Pages
|