addaptic

Reference Decimal standard

lz_round_integral

The number rounded to a whole number, half-even by default.

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

Rounds to a whole number in the number's own rounding mode, half-even unless set otherwise, so 2.5 rounds to 2, 3.5 to 4, and −2.5 to −2.

Examples

CallAnswer
lz_round_integral( 2.5 )2
lz_round_integral( 3.5 )4
lz_round_integral( −2.5 )−2
lz_round_integral( 2.7 )3

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 The number rounded in its own rounding mode, half-even by default.
  • lz_integer The whole part of the number, truncated toward nought.