Re: Does the order matter to add a sequence of floating numbers
- From: Richard Heathfield <rjh@xxxxxxxxxxxxxxx>
- Date: Tue, 30 Oct 2007 16:29:00 +0000
JosephLee said:
Let's say float arr[100], we want to add them up, does the order
matter? what is the different between arr[0] +..+ arr[99], and
arr[99]+...+arr[0]?
You wouldn't think it would make a difference, would you? But it can,
nevertheless, especially when some or all of the values are near the
limits of what can be represented.
I tried fairly hard to write a program to demonstrate this, and failed. :-)
--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
.
- Follow-Ups:
- Re: Does the order matter to add a sequence of floating numbers
- From: CBFalconer
- Re: Does the order matter to add a sequence of floating numbers
- From: user923005
- Re: Does the order matter to add a sequence of floating numbers
- From: blmblm
- Re: Does the order matter to add a sequence of floating numbers
- References:
- Does the order matter to add a sequence of floating numbers
- From: JosephLee
- Does the order matter to add a sequence of floating numbers
- Prev by Date: Does the order matter to add a sequence of floating numbers
- Next by Date: Binary search trees
- Previous by thread: Does the order matter to add a sequence of floating numbers
- Next by thread: Re: Does the order matter to add a sequence of floating numbers
- Index(es):
Relevant Pages
|