Skip to content

antenna: (fixes #889) Improve WrapTo* functions

Ben Lee requested to merge limjcst/ns-3-dev:fix-invalid-wrap into master
  • Test inputs around the lower and the upper bounds for WrapTo180, WrapTo360, WrapToPi, and WrapTo2Pi.
  • Re-implement these 4 functions with one inline function WrapToRange.

WrapToRange increases the input angle with the length of the interval, i.e., upperBound - lowerBound. As a result, the significant digits that makes a + upperBound - lowerBound == upperBound - lowerBound will be dropped due to the float pointing error, before entering the first branch.

#889 (closed)

Edited by Ben Lee

Merge request reports