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 see around the problem. Any help would be greatfully recieved.
Oh and i am using visual C++ dev environment
Thanks in advance
I have looked arounding, casting and the use of sprintf like statements but can't see around the problem. Any help would be greatfully recieved.
Oh and i am using visual C++ dev environment
Thanks in advance
Comment