lz_round
The number rounded in its own rounding mode, half-even by default.
long lz_round( CLZNumber* leftOperand, CLZNumber* targetNumber = nullptr );
Rounds at the number's own precision and in its own rounding mode, the ones it was made with: the working precision at the time, and half-even, unless set otherwise. A number already within its precision is unchanged; the last example is a number made at four places.
Examples
| Call | Answer |
|---|---|
lz_round( 2.5 ) | 2.5 |
lz_round( 3.5 ) | 3.5 |
lz_round( 1.23456789 ) 4 places | 1.2346 |
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_round_integralThe number rounded to a whole number, half-even by default.lz_round_last_digitThe number rounded at its own last place.lz_quantizeThe left number rounded to as many places as the right number has.