Function note

ROUNDUP, ROUNDDOWN and TRUNC read num_digits from its low 16 bits

FUNC.ROUNDDOWN · FUNC.ROUNDUP · FUNC.TRUNC

FN-ROUNDUP-001: ROUNDUP, ROUNDDOWN and TRUNC read num_digits from its low 16 bits

Excel differs from the mathematical answer · measured · recorded 2026-11-04

ROUNDUP, ROUNDDOWN and TRUNC take the digit count from the low 16 bits of the integer part of |num_digits|, with the sign of num_digits. If |num_digits| is 2^32 or more, or those low bits are 32768 or more, the truncation happens at 100 places (10^-100, or 10^100 for a negative count). So 65536 acts as 0, 65537 as 1, 32768 to 65535 as 100, and -2147483748, whose low 16 bits are 100, as -100. In the out-of-range case ROUNDUP adds no unit for a positive count, and gives #NUM! for a negative count when a digit is dropped.

Call and input routeInputsExcelCorrect valueRecorded in
ROUNDUP(1.234567890123456e-200, 65536)
cell-value2
number: 1.234567890123456e-200
0x166e3d71f622be8f
num_digits: 65536
0x40f0000000000000
1
0x3ff0000000000000
1.234567890123456e-200
0x166e3d71f622be8f
Excel 16.0 build 20430, Windows 64-bit, CPU not recorded in this capture
ROUNDUP(1.234567890123456e-200, 65537)
cell-value2
number: 1.234567890123456e-200
0x166e3d71f622be8f
num_digits: 65537
0x40f0001000000000
0.1
0x3fb999999999999a
1.234567890123456e-200
0x166e3d71f622be8f
Excel 16.0 build 20430, Windows 64-bit, CPU not recorded in this capture
ROUNDUP(1.234567890123456e-200, 32768)
cell-value2
number: 1.234567890123456e-200
0x166e3d71f622be8f
num_digits: 32768
0x40e0000000000000
0
0x0000000000000000
1.234567890123456e-200
0x166e3d71f622be8f
Excel 16.0 build 20430, Windows 64-bit, CPU not recorded in this capture
TRUNC(1.234567890123456e-200, 65536)
cell-value2
number: 1.234567890123456e-200
0x166e3d71f622be8f
num_digits: 65536
0x40f0000000000000
0
0x0000000000000000
1.234567890123456e-200
0x166e3d71f622be8f
Excel 16.0 build 20430, Windows 64-bit, CPU not recorded in this capture

Correct value: The exact decimal expansion of this binary64 number has fewer than 32768 places, so a truncation at num_digits places returns the number itself.

Correct value: The exact decimal expansion of this binary64 number has fewer than 32768 places, so a truncation at num_digits places returns the number itself.

Correct value: The exact decimal expansion of this binary64 number has fewer than 32768 places, so a truncation at num_digits places returns the number itself.

Correct value: The exact decimal expansion of this binary64 number has fewer than 32768 places, so a truncation at num_digits places returns the number itself.

Basis: Under the family rules the recorded rows match ROUND 36,821 of 36,945, ROUNDUP 52,022 of 52,841, ROUNDDOWN 59,182 of 59,995 and TRUNC 50,504 of 51,317, with no row lost and each remaining failure classified in the write-up. All 13,914 informative ROUNDDOWN and TRUNC rows with large num_digits follow the rule.

Evidence and capture sources

Machine-readable note records