addaptic

Reference Arithmetic

lz_reciprocal

One over the number.

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

One divided by the number, correctly rounded at the working precision; a small reciprocal keeps its significant digits. The reciprocal of nought returns kDivideByZero, flagged infinite, and the reciprocal of an infinity is a plain nought.

Examples

CallAnswerReturns
lz_reciprocal( 3 )0.333333333333333333333333333333333333kNoError
lz_reciprocal( 0.25 )4kNoError
lz_reciprocal( 7 ) base 160.249249249249249249249249249249249249 base 16kNoError
lz_reciprocal( 0 )infinitekDivideByZero

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_divide The quotient of two numbers, left over right.
  • lzc_divide The quotient of two complex numbers, left over right.