GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — lib: fix `evenRound` sign for fractional values in (-1, 1) by deepview-autofix · Pull Request #62837 · nodejs/node

Conversation

@deepview-autofix

@deepview-autofix deepview-autofix commented Apr 20, 2026 •
edited by ChALkeR
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

evenRound derived the rounding direction from MathSign(i) where i = integerPart(x). For any x whose truncated integer part is zero (e.g. 0.7, -0.7), sign was 0, so the non-halfway branch returned i + sign === 0 instead of rounding away from zero.

This produced incorrect [Clamp] WebIDL integer conversions for fractional inputs in (-1, 0) ∪ (0, 1) that are not exactly ±0.5

Observable e.g. via new Blob([Uint8Array.of(1,2,3)]).slice(-0.9999999) returning the whole blob instead of a 1-byte slice.

Use MathSign(x) so the rounding direction follows the sign of the original value.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@deepview-autofix @claude @ChALkeR
lib: fix evenRound sign for fractional values in (-1, 1)
cc729e8
`evenRound` derived the rounding direction from `MathSign(i)` where
`i = integerPart(x)`. For any `x` whose truncated integer part is zero
(e.g. `0.7`, `-0.7`), `sign` was `0`, so the non-halfway branch returned
`i + sign === 0` instead of rounding away from zero. This produced
incorrect `[Clamp]` WebIDL integer conversions for fractional inputs in
`(-1, 0) ∪ (0, 1)` that are not exactly `±0.5`, observable e.g. via
`new Blob([Uint8Array.of(1,2,3)]).slice(-0.9999999)` returning the whole
blob instead of a 1-byte slice. Use `MathSign(x)` so the rounding
direction follows the sign of the original value.

Co-Authored-By: Claude <[email protected]>
Co-Authored-By: DeepView Autofix <[email protected]>
Co-Authored-By: Nikita Skovoroda <[email protected]>
Signed-off-by: Nikita Skovoroda <[email protected]>
@nodejs-github-bot nodejs-github-bot added the needs-ci PRs that need a full CI run. label Apr 20, 2026
@ChALkeR ChALkeR added the web-standards Issues and PRs related to web-platform APIs and standards compliance. label Apr 20, 2026
ChALkeR
ChALkeR reviewed Apr 20, 2026
View reviewed changes

@ChALkeR ChALkeR left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

This is mine (scanner + autofixer)


Node.js, prior to the patch:

image

Chrome:

image

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ChALkeR
ChALkeR marked this pull request as ready for review April 20, 2026 03:55
@codecov

codecov Bot commented Apr 20, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.62%. Comparing base (14e16db) to head (cc729e8).
⚠️ Report is 112 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #62837   +/-   ##
=======================================
  Coverage   89.62%   89.62%           
=======================================
  Files         706      706           
  Lines      219136   219136           
  Branches    41987    41981    -6     
=======================================
+ Hits       196404   196410    +6     
- Misses      14611    14614    +3     
+ Partials     8121     8112    -9     
Files with missing lines Coverage Δ
lib/internal/webidl.js 96.62% <100.00%> (ø)

... and 26 files 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.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

ljharb
ljharb approved these changes Apr 20, 2026
View reviewed changes
@ChALkeR

ChALkeR commented Apr 27, 2026

Copy link
Copy Markdown
Member

Closing in favor of #62979

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ChALkeR ChALkeR closed this Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@ChALkeR ChALkeR ChALkeR left review comments
@ljharb ljharb ljharb approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

needs-ci PRs that need a full CI run. web-standards Issues and PRs related to web-platform APIs and standards compliance.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@deepview-autofix @ChALkeR @ljharb @nodejs-github-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.