I sort of got to that conclusion myself. So wghat i do now is subtract the numbers and look at the size of the error making assumptions based on that size. Not perfect i know but it for my situation it seems to work.
Thanks for the input
MIKE
User Profile
Collapse
-
floating points and precision
I am writing a test harness for a piece of code that will run on a DSP. It uses floats and i need to simulate their manipulation. The problem is that as i decrement a float (say by 0.005) errors accumulate so when i need to do a compare the low end decimals are inacurate. ie if i need to comapre a number to 0.05 it may read as 0.049999999 and so will be false.
I have looked arounding, casting and the use of sprintf like statements but can't...
No activity results to display
Show More
Leave a comment: