Re: doubles or not

From: George Hester (hesterloli_at_hotmail.com)
Date: 04/16/04


Date: Thu, 15 Apr 2004 21:48:16 -0400

One place you would not want to use a double is something like this:

double i;
for (i = 1.0; i != 2.0; i += 0.2){}

I don't think this will ever stop.

-- 
George Hester
__________________________________
"bdg" <ased@noo.com> wrote in message news:emhgrAdIEHA.3988@tk2msftngp13.phx.gbl...
> "Avoid using doubles when integers will do..."
> 
> How could this be true?  Since whenever we have to represent a number to
> certain extent of accuracy of certain digits after decimal point and when
> even a float can not be enough for this, we may need doubles.  Am I missing
> something?
> 
> Thanks!
> 
> 
> 


Relevant Pages

  • Re: doubles or not
    ... > even a float can not be enough for this, we may need doubles. ... the point that you are missing is "..when integers will do". ... integer math. ...
    (microsoft.public.vc.language)
  • doubles or not
    ... "Avoid using doubles when integers will do..." ... even a float can not be enough for this, we may need doubles. ... Am I missing ...
    (microsoft.public.vc.language)
  • Re: using MFC VC++ - which is more efficient - float or double?
    ... I'm about to say may be null and void. ... I don't think its true that the hardware does everything as doubles. ... there's nothing that is 'saved' by using float. ... If you are working with large sets of data, then memory. ...
    (microsoft.public.vc.mfc)
  • Re: using MFC VC++ - which is more efficient - float or double?
    ... I'm about to say may be null and void. ... As far as I know everything is floating point and doubles takes extra processing to emulate. ... there's nothing that is 'saved' by using float. ... This gets to be a problem sometimes even with a Gig or several Gigs of memory. ...
    (microsoft.public.vc.mfc)
  • Re: using MFC VC++ - which is more efficient - float or double?
    ... Measurements made in debug mode are usually useless. ... float f2 = 5.0; ... __declspecvoid DoubleComputation() ... I don't think its true that the hardware does everything as doubles. ...
    (microsoft.public.vc.mfc)