addaptic

Reference Powers and roots

lz_root_n

The root of the left number whose order is the right.

long lz_root_n( CLZNumber* leftOperand, CLZNumber* rightOperand, CLZNumber* targetNumber = nullptr );

x1/n. Where one over the order is whole it is a power, so the root of order ½ is the square; otherwise it is e to the logarithm over the order. An odd whole order takes a negative number to its real root: the fifth root of −32 is −2. A root of whole order exactly on a half is decided exactly.

Examples

CallAnswer
lz_root_n( 32, 5 )2.000000000000000000000000000000000000
lz_root_n( 2, 0.5 )4.000000000000000000000000000000000000
lz_root_n( −32, 5 )−2.000000000000000000000000000000000000
lz_root_n( 10, 2.5 )2.511886431509580111085032067799327394

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