|
inlineconstexpr |
Defined in Header
Parameters
x
, y
: floating real values
Return value
the arc tangent of \(\frac{y}x\) in the range \([-\pi , +\pi]\) radians, is returned. The IEEE limiting values are almost all satisfied :
x
and y
are both zero or infinites, Nan is returned (this is not standard conforming)y
is \(\pm0\) and x
is strictly negative or \(-0\), \(\pm\pi\) is returnedy
is \(\pm0\) and x
is strictly positive or \(+0\), \(\pm0\) is returnedy
is \(\pm\infty\) and x
is finite, \(\pm\frac\pi2\) is returnedx
is \(\pm0\) and y
is strictly negative, \(-\frac\pi2\) is returnedx
is \(\pm0\) and y
is strictly positive, \(+\frac\pi2\) is returnedx
is \(-\infty\) and y
is finite and positive, \(+\pi\) is returnedx
is \(-\infty\) and y
is finite and negative, \(-\pi\) is returnedx
is \(+\infty\) and y
is finite and positive, \(+0\) is returnedx
is \(+\infty\) and y
is finite and negative, \(-0\) is returnedIf either x
is Nan or y
is Nan, Nan is returned
The call will return a NaN if x
and y
are both either null or infinite: this result is not IEEE conformant, but allows to simplify (and speed) the implementation. In all other cases, the result is standard conformant.
The result type is the common value type of the two parameters.
The call pedantic(atan2)(
x,
y)
returns the same results as the regular call, but all IEEE limiting values are satisfied :
y
is \(\pm\infty\) and x
is \(-\infty\), \(\pm\frac{3\pi}4\) is returnedy
is \(\pm\infty\) and x
is \(+\infty\), \(\pm\frac{\pi}4\) is returnedx
is \(\pm0\) and y
is \(\pm-0\), \(-\frac\pi2\) is returnedx
is \(\pm0\) and y
is \(\pm+0\), \(+\frac\pi2\) is returned