atan2

Calculates the arc tangent of y / x, returning a value ranging from -π to π. Exceptions:

InvalidOperationExceptionx or y is signaling NaN
InexactExceptionthe result is inexact
UnderflowExceptionthe result is too small to be represented
More...
@IEEECompliant("atan2", 43)
atan2
(
D1
D2
)
(
auto const ref D1 y
,
auto const ref D2 x
)
if (
isDecimal!(D1, D2)
)

Detailed Description

Special values

yxatan2(y, x)
NaNanyNaN
anyNaNNaN
±0.0-0.0±π
±0.0+0.0±0.0
±0.0<0.0±π
±0.0>0.0±0.0
±∞-∞±3π/4
±∞+∞±π/4
±∞any±π/2
any-∞±π
any+∞±0.0

Examples

decimal32 y = 10;
decimal32 x = 0;
assert (atan2(y, x) == decimal32.PI_2);

Meta