root

Compute the value of x1/n, where n is an integer

@IEEECompliant("rootn", 42)
D
root
(
D
)
(
auto const ref D x
,
const T n
)
if (
isDecimal!D & isIntegral!T
)

Throws

InvalidOperationExceptionx is signaling NaN
DivisionByZeroExceptionx = ±0.0 and n < 0.0
OverflowExceptionresult is too big to be represented or n = -1
UnderflowExceptionresult is too small to be represented or n = -1
InexactExceptionresult is inexact

Special values

xyroot(x, n)
sNaNanyNaN
any0NaN
any-1NaN
NaNanyNaN
±∞any±∞
±0.0odd n < 0±∞
±0.0even n < 0+∞
±0.0odd n > 0±0.0
±0.0even n > 0+0.0

Meta