User Tools

Site Tools


floating_point_comparison

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
floating_point_comparison [2022/04/29 23:53]
max
floating_point_comparison [2022/04/29 23:54] (current)
max
Line 22: Line 22:
 ===== The relative method ===== ===== The relative method =====
  
-The relative method takes the base of the absolute method and multiplies the epsilon by ''x'' or ''y'', depending on which is larger.+The relative method takes the absolute method, but multiplies the epsilon by ''x'' or ''y'', depending on which is larger.
  
 The drawback to this method is that it does not work on small values. The drawback to this method is that it does not work on small values.
Line 30: Line 30:
 Considering the strengths and drawbacks of the two methods above, you can combine the two to overcome these limitations.  Considering the strengths and drawbacks of the two methods above, you can combine the two to overcome these limitations. 
  
-The combined method takes the base of the relative method and multiplies the epsilon by the largest absolute number out of a set of ''1'', ''x'', or ''y''. Very similar to the relative method.+The combined method takes the relative method, but multiplies the epsilon by the largest absolute number out of a set of ''1'', ''x'', or ''y''. Very similar to the relative method.
  
 This method gives us good results, but it is not without its drawbacks since it uses the same epsilon for the relative and the absolute tolerance.  This method gives us good results, but it is not without its drawbacks since it uses the same epsilon for the relative and the absolute tolerance. 
  
 For further reading, please check out [[http://www.realtimecollisiondetection.net/pubs/Tolerances/|Christer Erison's research on this topic.]] For further reading, please check out [[http://www.realtimecollisiondetection.net/pubs/Tolerances/|Christer Erison's research on this topic.]]
floating_point_comparison.txt ยท Last modified: 2022/04/29 23:54 by max