Re: why float
- From: "Bruce Wood" <brucewood@xxxxxxxxxx>
- Date: 29 Apr 2006 21:27:44 -0700
Nick Hounsome wrote:
"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.
Yes, that's more or less what I remember, too.
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.
Agreed. It was just that certain algorithms required judicious use of
single-precision in order to stop rounding errors from amplifying
themselves. I remember it only because it was counter-intuitive.
.
- References:
- why float
- From: Martijn Mulder
- Re: why float
- From: Bruce Wood
- Re: why float
- From: Martijn Mulder
- Re: why float
- From: Nick Hounsome
- why float
- Prev by Date: Re: Fastest Way for Threads to Display on Picture Boxes?
- Next by Date: Re: How to send a MemoryStream to Client
- Previous by thread: Re: why float
- Next by thread: Re: why float
- Index(es):
Relevant Pages
|