addaptic

Reference Complex arithmetic

lzc_divide

The quotient of two complex numbers, left over right.

long lzc_divide( CLZComplex* leftOperand, CLZComplex* rightOperand, CLZComplex* targetNumber = nullptr );

Each part worked from exact intermediates and rounded once. A division by nought returns kDivideByZero with both parts infinite: the one point at infinity, since this engine's infinities carry no sign and so a complex one has no direction.

Examples

CallAnswerReturns
lzc_divide( 1 + 2i, 3 + 4i )0.44 + 0.08ikNoError
lzc_divide( 1 + 0i, 0 + 1i )0 − 1ikNoError
lzc_divide( 1 + 1i, 0 + 0i )the point at infinitykDivideByZero

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