Re: why float

Tech-Archive recommends: Fix windows errors by optimizing your registry



Waaaay back in my university days, in my Numerical Analysis course, I
remember one example in which using doubles everywhere (the obvious
solution) actually increased error and gave a less precise answer than
judicious application of floats in the right places.
<snip>

That is unlikely. A double *is* a float with more precision. So it will
always be as precise or more precise than a flaot is. Answers given in the
line of "32 bit is favored" are platform-dependenpt and not realy
convincing. Why is there a fundamental type 'float' and a fundamental type
'double' that both do the same thing? When to use the one, when to use the
other?


.



Relevant Pages

  • Re: why float
    ... solution) actually increased error and gave a less precise answer than ... A double *is* a float with more precision. ... It is possibly to do with spurious precision in the doubles - in numerical ... I think it depends on teh algorithm as well. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: why float
    ... only need a float so that you don't use the extra space. ... Many programs will retrieve the data from a database and in my opinion, ... I can understand that languages like C and C++ have two different floating ...
    (microsoft.public.dotnet.languages.csharp)
  • 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)