Floating Point Absorbtion

This topic is 4904 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

Does anyone have a convient way to determine the fall off of accuracy in a IEEE Floating point? I'm trying to avoid the absorption issue as the floating point grows larger. http://en.wikipedia.org/wiki/Floating-point#Problems_with_floating-point. Basically I'd like to ensure percision of adding 0.01, so I'm wondering when the addition (or subtraction) will cease to be tallied because of rounding. So far I'm short of going and pouring over IEEE 754, but if there is a convient way to determine this that I'm not seeing, feel free to enlighten.

Share on other sites
Basically multiply the magnitude of the value by the machine epsilon for the data type and you'll get the minimum value to add to the number that will change the value.

Share on other sites
Danke
Edit: Results
Working from MSVC off double / long double (same size in MSVC, 64bit)
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclang98/html/_clang_limits_on_floating.2d.point_constants.asp

DBL_EPSILON = 2.2204460492503131e-016 -> 0.00000000000000022204460492503131
Rounding down to the the first whole increment of 1, makes the
DBL_EPSILON 1e-15, 0.000000000000001
Now if I'm understand things correctly.
Since I only need percision too 0.01 or 1e-2, that gives me up to 1e13 and still able to be accurate to 0.01

Sorry if the above sounds horrible especially to math or science majors. ;)

[Edited by - MustEatYemen on July 10, 2005 11:45:56 PM]

Share on other sites
You are correct. The actual number is 0.01 / 2.2204460492503131e-016 which is approximately 4.5x1013

Share on other sites
Just remember that my math would be off because the system isn't base10 but base2. So JohnBolton is correct, and I'll tweak it, but that's the general idea. ;)

1. 1
2. 2
Rutin
18
3. 3
4. 4
5. 5

• 26
• 11
• 9
• 9
• 11
• Forum Statistics

• Total Topics
633702
• Total Posts
3013448
×