atan2(y,x) requires a lot of bits in the integer part when x is near-zero. This is because atan2(y,x) does atan(y/x) internally and y/x easily overflows for very small x unless you have more integer bits than fraction bits.
However, atan(q) does 1/q if q > 1, thereby inverting the original division in atan2. So this overflow can be avoided if these divisions are shortcut.
atan2(y,x)
requires a lot of bits in the integer part whenx
is near-zero. This is becauseatan2(y,x)
doesatan(y/x)
internally andy/x
easily overflows for very smallx
unless you have more integer bits than fraction bits. However,atan(q)
does1/q
ifq > 1
, thereby inverting the original division inatan2
. So this overflow can be avoided if these divisions are shortcut.Closes #18