fix: preserve sign in math/base/special/{ceil2,floor2} - #15686
Merged
Merged
Conversation
Propagates fix from 85d7c62 ("fix: preserve sign") to sibling packages which return the absolute value of the input when provided the negative smallest subnormal. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TurpzeynpkmbhtrFiaufhM
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
kgryte
approved these changes
Sep 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This pull request:
developbetween 2026-09-29 and 2026-09-30 to sibling packages.round2returning the absolute value of the input when provided the negative smallest subnormal.ceil2andfloor2share the same early return, in both the JavaScript and C implementations:ceil2( -SMALLEST_SUBNORMAL )andfloor2( -SMALLEST_SUBNORMAL )currently return+SMALLEST_SUBNORMAL. The JavaScript implementations now returnsign * xand the C implementations returnx, matchinground2. The added tests mirror the one added in 85d7c62.@stdlib/math/base/special/ceil2@stdlib/math/base/special/floor2Related Issues
No.
Questions
No.
Other
The search covered every
lib/main.jsandsrc/main.cundermath/base/special/*that has a smallest-subnormal early return. Siblings that were checked and are already correct:round2(JS),floor2f,round10,ceil10,floor10.Other source commits in the window had no remaining sites to fix:
STDLIB_CONSTANT_*macro is an unparenthesized compound expression.ml/base/sgdenums and resolve benchmarks are already correct.strictEqual( ( a === b ), true )): no remaining occurrences.Validation: an independent review read each file in full and confirmed each site. The JS tests were run before and after the fix. Native builds were not available, so the C changes were not compiled or run.
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was written primarily by Claude Code as part of an automated fix-propagation routine.
@stdlib-js/reviewers
🤖 Generated with Claude Code
https://claude.ai/code/session_01TurpzeynpkmbhtrFiaufhM
Generated by Claude Code