addaptic

Reference Arithmetic

lz_abs

The absolute value.

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

The number without its sign, in its own base.

Examples

CallAnswer
lz_abs( −2.5 )2.5
lz_abs( 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_negate The number with its sign changed.
  • lzc_abs The modulus of a complex number, |z|, a real answer.