Math and trigonometry functions

INT

Known larger differences on 4 of 124,561 recorded answers

Of 124,561 recorded answers (124,403 in the answer bank and 158 workbook cells), 4 do not match: 2 differ by at most 16 ULP, 2 are refused. How we measure this · See the Rust code

Local names in 40 languages
LanguageName in Excel
ArabicINT
BulgarianINT
CzechINT
DanishINT
GermanINT
GreekINT
English (Australia)INT
English (United Kingdom)INT
English (United States)INT
SpanishINT
EstonianINT
FinnishINT
FrenchINT
HebrewINT
CroatianINT
HungarianINT
IndonesianINT
ItalianINT
JapaneseINT
KoreanINT
LithuanianINT
LatvianINT
NorwegianINT
DutchINT
PolishINT
Portuguese (Brazil)INT
Portuguese (Portugal)INT
RomanianINT
RussianINT
SlovakINT
SlovenianINT
Serbian (Latin)INT
SwedishINT
ThaiINT
TurkishTAMSAYI
UkrainianINT
VietnameseINT
Chinese (Simplified)INT
Chinese (Hong Kong)INT
Chinese (Traditional)INT

Names from Microsoft's support site.

What it does

INT(number)

INT(number) rounds down to an integer, toward negative infinity. This makes negative fractions more negative: it is a different direction from TRUNC. The recorded compatibility route also has a preliminary decimal reading near integer boundaries.

Try it

Input cells (optional)

Example: {"B2": 3, "B3": 4}. A1 holds the formula. Other cells need values before a formula can read them.

Enter a formula, then calculate.

Runs locally in your browser with OneCalc. Its answer may differ from Excel. Use English function names and commas between arguments.

=INT(-6.8) returns -7, while =TRUNC(-6.8) returns -6. =INT(6.8) returns 6. For an ordinary positive amount, subtracting its INT result extracts the fractional part.

A boundary control from the source is different from mathematical floor of the incoming binary value: an exact cell value 2.9999999999999982 gives 3 on the recorded build. Entering a decimal formula literal can change the value before INT sees it; retain the exact cell input when reproducing that control.

Quirks

The fifteen-digit reading can cross an integer. Calling a language's floor on the incoming double therefore misses recorded answers. The current implementation applies this reading only below magnitude 1e15; larger values use binary64 floor directly. For example, the recorded 4503599627370495.5 floors to 4503599627370495, while its fifteen-digit decimal reading would have crossed upward.

INT has no digit-count argument. The direction for ordinary negative fractions is toward negative infinity; ROUNDDOWN and TRUNC use toward zero. Numeric conversion, errors and array handling belong to the worksheet wrapper, separately from this finite scalar recipe.

How to implement

The current code separates decimal reading from binary floor:

  1. If abs(x)>=1e15, floor the exact binary64 value. A value already integral is unchanged; for a negative value with a fractional part, the result is one less than its toward-zero truncation.
  2. Below that threshold, obtain the shortest decimal that converts back to the input binary64. If it has at most fifteen significant digits, use that exact decimal; otherwise decode the exact binary64 as a rational or exact decimal.
  3. Round that reading to fifteen significant decimal digits, choosing the larger magnitude at an exact decimal half. When this did not change the reading, the current code falls back to floor of the incoming binary64.
  4. When the reading changed, truncate its decimal fraction toward zero and convert the whole value to binary64. Also convert the full reading. If the full reading is below the truncated whole value, subtract one; otherwise retain the whole value.

For 2.9999999999999982, the shortened fifteen-digit reading is 3, so the answer is three. For -6.8, the integral truncation is minus six and the number lies below it, so floor gives minus seven. Do not reuse ROUND's preliminary x87 scale operation: INT's current decimal helper is a separate route.

The calculation source reports 109 COM controls on build 20527, including both sides of small integers and the large-value exception. Those controls support this implementation on their stated inputs; they do not identify every conversion or workbook route. The stored-arithmetic chapter explains exact input decoding when a host decimal representation is unsuitable.

Rust code

Show the CalcFunc source of this function

Quoted from the public repository DnaCalc/DnaCalc, crates calc-func and calc-fml, at commit 9e1884369a67. Comments are the source's own. A kernel shared with other functions appears once, on its module page.

INT · 1 lines · calc-func/src/catalogue/rounding.rs on GitHub
call(INT, "INT", 1, NUMBER, int)
int · 29 lines · calc-func/src/catalogue/rounding.rs on GitHub
/// INT: the largest integer not above the number read to 15 significant digits
/// ([`ExactDecimal::fifteen`]) when it is below 1E15 in magnitude, and not above its binary64
/// otherwise (dc-bd5, Excel 16.0.20527 through COM on 2026-10-30, 109 readings:
/// INT(2.9999999999999996) and INT(2.9999999999999982) are 3, INT(123456789012345.67) is
/// 123456789012346, INT(-3.0000000000000004) is -3, INT(999999999999999.5) is 1E15, while
/// INT(4503599627370495.5) is 4503599627370495).
fn int(
    arguments: &[CalcValue],
    services: &mut EvalServices<'_>,
) -> Result<CalcValue, FunctionFault> {
    numeric(INT, arguments, services, |site, n| {
        let x = n[0];
        if x.abs() >= 1e15 {
            return Ok(decimal::floor(x));
        }
        match ExactDecimal::fifteen(x) {
            (reading, true) => match reading.round_at(0, Direction::TowardZero) {
                Some(whole) => {
                    let whole = site.nearest(&whole)?;
                    let read = site.nearest(&reading)?;
                    // Toward zero, one less for a negative reading with a fraction.
                    Ok(if read < whole { whole - 1.0 } else { whole })
                }
                None => site.nearest(&reading),
            },
            (_, false) => Ok(decimal::floor(x)),
        }
    })
}

Kernels shared with other functions

Argument and result plumbing

No implementation has been published with a Handbook test suite for this function.

Version differences

The recorded environments below distinguish a reading from a same-input comparison. Counts describe captured inputs in each environment; overlapping captures and comparisons are not totals of unique worksheet calls.

Excel 16.0 buildPlatform and CPUCaptured inputs
19929Windows, bitness not recorded, CPU not recorded40
20430Windows, 64-bit, CPU not recorded124,403
  • XC-INT-001: build 19929 versus build 20430; 2 same-input pairs, 0 differing answers. Compared axes: excel-build. Numeric answers were compared by their recorded binary64 bits; other answers by typed value.

Agreement on these compared inputs does not establish agreement on unmeasured inputs.

Recorded environments and comparison details.

The current source also retains a later build-20527 COM group of 109 INT readings from 30 October 2026. It records INT(2.9999999999999982)=3 and the large-input exception INT(4503599627370495.5)=4503599627370495. These are additional controls, not a matched-input comparison with the earlier environments.

Retained controls from the indexed captures:

Build and recorded CPUCaptured call or argumentsExcel result
19929, CPU not recorded=INT(0)0.0 (0x0000000000000000)
20430, CPU not recordedINT(1)1 (0x3ff0000000000000)

These are earlier recorded answers, not new Excel runs or an additional cross-build comparison. The function JSON retains each source locator, exact argument bits where available, and input-route status. Call notation does not imply that captured binary64 values were entered as decimal formula literals.

Excel 16.0 build 19929

Windows, bitness not recorded, CPU not recorded

40 captured inputs are indexed for this environment. Capture dates are not recorded. This is a reading count, not a comparison with another build. Retained control =INT(0) returned 0.0 (0x0000000000000000). The selected archive row does not record its input plumbing; no input route is inferred.

Observed formulas and results
  • =INT(0) → 0.0
    0x0000000000000000 (not-recorded)

Excel 16.0 build 20430

Windows, 64-bit, CPU not recorded

124,403 captured inputs are indexed for this environment. Capture dates: 2026-09-29 to 2026-09-29. This is a reading count, not a comparison with another build. Retained control INT(1) returned 1 (0x3ff0000000000000). The capture specifies exact-double bulk Value2 cell input.

Observed formulas and results
  • INT(1) → 1
    0x3ff0000000000000 (cell-value2)

Excel 16.0 build 20527

Windows through COM; bitness and CPU not stated in this comment

The current source also retains a later build-20527 COM group of 109 INT readings from 30 October 2026. It records `INT(2.9999999999999982)=3` and the large-input exception `INT(4503599627370495.5)=4503599627370495`. These are additional controls, not a matched-input comparison with the earlier environments.

Alternatives

TRUNC removes a fraction toward zero. FLOOR.MATH chooses a multiple with explicit negative-number mode, and ROUND chooses a nearest decimal position. MOD has a documented floor identity but a separately recovered numerical route.

Named variants

No named variants are recorded yet.

Suggest a correction or contribute an implementation · For agents