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
| Call | Answer | Returns |
|---|---|---|
lz_reciprocal( 3 ) | 0.333333333333333333333333333333333333 | kNoError |
lz_reciprocal( 0.25 ) | 4 | kNoError |
lz_reciprocal( 7 ) base 16 | 0.249249249249249249249249249249249249 base 16 | kNoError |
lz_reciprocal( 0 ) | infinite | kDivideByZero |
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_divideThe quotient of two numbers, left over right.lzc_divideThe quotient of two complex numbers, left over right.