Comparing floating point variables
Hi everyone,
I am currently reading pae 57 in the book and it talks about the method ulp(). Would that method be used to check equality between 2 floating point values ?
I know we are not supposed to compare 2 FP values directly, but check if they are within the range of the unit in the last place .....
can anyone provide a quick snippet of code on how i would use ulp() for the situation described above.
Thanks
Patrick Picard
|