Skip to content

Add GESTEP function (HF-481) - #1788

Open
marcin-kordas-hoc wants to merge 6 commits into
developfrom
feat/hf-481-gestep
Open

marcin-kordas-hoc wants to merge 6 commits into
developfrom
feat/hf-481-gestep

Conversation

@marcin-kordas-hoc

@marcin-kordas-hoc marcin-kordas-hoc commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Adds the GESTEP function (HF-481).

  • GESTEP(number, [step]) returns 1 when number >= step, otherwise 0. step defaults to 0.
  • Typed numbers (percentages, dates, currency cells) are compared as plain numbers. Errors in either argument propagate.
  • Implemented in DeltaPlugin next to DELTA, with a metadata catalogue entry, translations for all built-in languages (English names kept, as no localized name was confirmed) and a CHANGELOG entry.

Also in this pull request: number literals with an uppercase exponent

src/parser/LexerConfig.ts makes the number-literal pattern case-insensitive, so =1E5, =1E-300 and =1.5E2 parse. Before, only the lowercase 1e5 was accepted and the uppercase form was a parse error, although Excel accepts both (=GESTEP(-1E-300,0) was measured in Excel). The change applies to every formula; it is covered by a parser test (unit/parser/decimal.spec.ts) and recorded under Fixed in the CHANGELOG. It is in this pull request because the GESTEP tests use such literals; it can be split out if you prefer.

Behaviour check against Excel

57 formulas for GESTEP and DELTA were evaluated in Excel Online (MS Graph live session) and in HyperFormula: 56 identical and 1 not evaluable in Excel (too many arguments, which Excel refuses to accept).

Excel returns #VALUE! for a boolean (a literal or a cell holding TRUE/FALSE) and for the empty text "" in these functions, and accepts numbers, dates, numeric text and empty cells (an empty cell is 0). HyperFormula used to convert booleans and "" to numbers, for DELTA as well. Both functions now follow Excel, so this pull request also changes the existing DELTA: =DELTA(FALSE()) was 1 and is now #VALUE!. It is recorded under Fixed in the CHANGELOG.

Comparison is exact on both sides, as in Excel: GESTEP(0.1+0.2, 0.3) is 1 and GESTEP(0.3, 0.1+0.2) is 0 (measured), and both are in the tests.

Tests

Paired tests branch: feat/hf-481-gestep in the tests repository (GESTEP and DELTA specs: 70 tests, plus a parser test). Full local run on this head: 503 suites, 6299 passed, 3 skipped.

🤖 Generated with Claude Code


Note

Medium Risk
DELTA behavior change can break existing sheets that passed booleans or empty strings, and the lexer change affects parsing of all numeric literals project-wide.

Overview
Adds GESTEP(number, [step]), returning 1 when number >= step (default step 0) and 0 otherwise, wired through DeltaPlugin, function metadata, license capabilities, and all language packs.

DELTA argument handling now matches Excel: booleans and empty text "" yield #VALUE! instead of being coerced to numbers; numeric text, dates, and empty cells still work. The second argument is validated first so its errors take precedence.

The formula lexer now accepts uppercase scientific notation (e.g. =1E5, =1E-3) via a case-insensitive exponent on number literals, fixing parse errors that lowercase-only parsing caused.

Reviewed by Cursor Bugbot for commit 04c400c. Bugbot is set up for automated code reviews on this repo. Configure here.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
hyperformula-docs 04c400c Commit Preview URL

Branch Preview URL
Oct 08 2026, 04:26 AM

@github-actions

github-actions Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Performance comparison of head (04c400c) vs base (3a9c34b)

                                     testName |    base |    head | change
--------------------------------------------------------------------------
                                      Sheet A |  509.02 |  512.43 | +0.67%
                                      Sheet B |  165.33 |  165.83 | +0.30%
                                      Sheet T |  146.27 |  148.85 | +1.76%
                                Column ranges |  477.36 |  485.06 | +1.61%
                                Sorted lookup | 14275.2 | 14737.3 | +3.24%
Sheet A:  change value, add/remove row/column |   16.09 |   16.08 | -0.06%
 Sheet B: change value, add/remove row/column |  147.82 |  141.37 | -4.36%
                   Column ranges - add column |  161.16 |  146.44 | -9.13%
                Column ranges - without batch |  487.98 |  449.28 | -7.93%
                        Column ranges - batch |  124.37 |  113.45 | -8.78%

marcin-kordas-hoc and others added 5 commits October 8, 2026 03:53
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Excel returns #VALUE! for a boolean and for the empty text in these functions and accepts numbers, dates,
numeric text and empty cells. Verified in Excel Online for 57 formulas; the list-of-differences entry for
GESTEP is no longer needed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 1fd6d3f. Configure here.

Comment thread src/interpreter/plugin/DeltaPlugin.ts Outdated
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Oct 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.28%. Comparing base (3a9c34b) to head (04c400c).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1788      +/-   ##
===========================================
+ Coverage    97.26%   97.28%   +0.02%     
===========================================
  Files          203      203              
  Lines        16022    16045      +23     
  Branches      3555     3561       +6     
===========================================
+ Hits         15583    15610      +27     
+ Misses         431      427       -4     
  Partials         8        8              
Files with missing lines Coverage Δ
src/i18n/languages/csCZ.ts 100.00% <ø> (ø)
src/i18n/languages/daDK.ts 100.00% <ø> (ø)
src/i18n/languages/deDE.ts 100.00% <ø> (ø)
src/i18n/languages/enGB.ts 100.00% <ø> (ø)
src/i18n/languages/esES.ts 100.00% <ø> (ø)
src/i18n/languages/fiFI.ts 100.00% <ø> (ø)
src/i18n/languages/frFR.ts 100.00% <ø> (ø)
src/i18n/languages/huHU.ts 100.00% <ø> (ø)
src/i18n/languages/idID.ts 100.00% <ø> (ø)
src/i18n/languages/itIT.ts 100.00% <ø> (ø)
... and 11 more

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant