addaptic

Reference Complex arithmetic

lzc_subtract

The difference of two complex numbers, left minus right.

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

Each part is the difference of the parts, exact unless it has more places than the working precision, when it is rounded in that target part's own rounding mode. A right operand in another base is brought into the left's exactly.

Examples

CallAnswer
lzc_subtract( 1 + 2i, 3 − 5i )−2 + 7i
lzc_subtract( 0.3 + 0i, 0.1 + 0i )0.2 + 0i

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_add The sum of two complex numbers.
  • lz_subtract The difference of two numbers, left minus right.