Reference Complex exponentials, logarithms, powers and roots
lzc_root_2
The principal square root of a complex number.
long lzc_root_2( CLZComplex* leftOperand, CLZComplex* targetNumber = nullptr );
The principal square root, its real part at or above nought, each part correctly rounded and exact where the mathematics is: the root of 3 + 4i is exactly 2 + i, and the root of −4 is exactly 2i. On the positive real axis it answers as lz_root_2 does, with an exact nought beside it.
Examples
| Call | Answer |
|---|---|
lzc_root_2( 3 + 4i ) | 2 + 1i |
lzc_root_2( −4 + 0i ) | 0 + 2i |
lzc_root_2( 0 + 2i ) | 1 + 1i |
Each answer is what Addaptic printed for the call, at 36 places unless a setting is shown.
Returns
kNoError (0) when the answer is written. Otherwise an error code, with the answer flagged infinite or not-a-number; see Errors and flags.
See also
lzc_root_3The cube root of a complex number; an odd root of a negative real is the real root.lzc_root_nThe principal root of complex order w, z^(1/w).lzc_squareThe complex number times itself.lz_root_2The square root.