addaptic

Reference Arithmetic

lz_negate

The number with its sign changed.

long lz_negate( CLZNumber* leftOperand, CLZNumber* targetNumber = nullptr );

The number with its sign changed, in its own base.

Examples

CallAnswer
lz_negate( 2.5 )−2.5
lz_negate( −0x1F )1F base 16

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

  • lz_abs The absolute value.
  • lz_plus The number itself, unchanged: the decimal standard's unary plus.
  • lzc_negate The complex number with both signs changed.