Re: why float
- From: "Nick Hounsome" <News@xxxxxxxxxxxxxxxxxx>
- Date: Sat, 29 Apr 2006 18:13:11 GMT
"Martijn Mulder" <i@m> wrote in message
news:44536053$0$12852$dbd4d001@xxxxxxxxxxxxxxxxxx
Waaaay back in my university days, in my Numerical Analysis course, I<snip>
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.
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?
What he is saying rings a bell with me too.
Unfortunately I failed my numerical analysis block so I can't add an
authoritative explanation either :(
It is possibly to do with spurious precision in the doubles - in numerical
analysis the inputs are usualy measurements approximating the true values
and do not have the number of significant digits in a double so when you
start using these extra digits you can introduce more error than if you
stuck with float ... or not. I think it depends on teh algorithm as well.
It's not realy an argument for float though because you can acheive the same
or better results by using double and reworking the algorithm and/or
rounding here and there.
.
- Follow-Ups:
- Re: why float
- From: Bruce Wood
- Re: why float
- From: Bruce Wood
- Re: why float
- References:
- why float
- From: Martijn Mulder
- Re: why float
- From: Bruce Wood
- Re: why float
- From: Martijn Mulder
- why float
- Prev by Date: Re: Downloading files
- Next by Date: Re: Transfer string data to unmanaged buffer
- Previous by thread: Re: why float
- Next by thread: Re: why float
- Index(es):
Relevant Pages
|