BRL-CAD's math library provides two macros, NEAR_ZERO() and NEAR_EQUAL() that test whether a number is approximately "0" or whether two numbers are approximately equal to each other. The numbers are "approximately" zero or equal based on a specified tolerance value. We recently added two new macros that simplify caller use, but they need to be propagated throughout the code.
This task involves going through and reviewing all calls to NEAR_ZERO and NEAR_EQUAL where the specified tolerance is SMALL_FASTF. The only caveat is that IF there is a comment nearby that mentions the tolerance, you're going to leave the call alone. You should only updated the ones that are not documented in some fashion.
Update all undocumented calls to our NEAR_ZERO(..., SMALL_FASTF) with calls to ZERO().
Update all undocumented calls to our NEAR_EQUAL(..., SMALL_FASTF) with calls to EQUAL().
File name/URL | File size | Date submitted | |
---|---|---|---|
macro.patch | 8.3 KB | December 19 2012 00:13 UTC |
I would like to work on this task.
This task has been assigned to javamonn. You have 72 hours to complete this task, good luck!
The work on this task is ready to be reviewed.
I worked off a fresh checkout, and ignored calls to NEAR_ZERO that involved subtraction since these were fixed with my other task. Let me know if you want me change calls that have have SQRT_SMALL_FASTF as their tolerance, I figured not since it's technically a tighter tolerance than SMALL_FASTF. I would have no issue with going back and changing these though. Also, noticed some calls to VNEAR_ZERO( ). Again, if this is stuff I should edit, just let me know.
Thanks,
Daniel
Congratulations, this task has been completed successfully.
What you did looks good. I didn't try to apply it as there are other patches pending, but it reads fine and is what was expected.