Skip to content

refactor: remove unused module imports in constants/float16/pi-squared and constants/float16/ln-two-pi - #16745

Merged
kgryte merged 2 commits into
developfrom
claude/cool-johnson-ccuz5z
Nov 21, 2026
Merged

kgryte merged 2 commits into
developfrom
claude/cool-johnson-ccuz5z

Conversation

@Planeshifter

Copy link
Copy Markdown
Member

Description

What is the purpose of this pull request?

This pull request:

  • removes the leftover // MODULES // sections from constants/float16/pi-squared and constants/float16/ln-two-pi so that both match the literal-only layout every other constants/float16 package uses. The exported values do not change.

constants/float16/pi-squared

  • Replaces float64ToFloat16( 9.8671875 ) with the literal 9.8671875 and drops the @stdlib/number/float64/base/to-float16 require. The value is already exact in half precision, so the conversion did nothing. The require was also missing from package.json. 52/53 (98%) of the namespace packages assign their value without a conversion call, and 49/53 (92%) have no // MODULES // section.

constants/float16/ln-two-pi

  • Deletes a // MODULES // section that held only the comment // (removed conversion import; not needed for hardcoded float16 value). 52/53 (98%) of the namespace packages have no modules section without a require.

Related Issues

Does this pull request have any related issues?

None.

Reference Packages

Did the content of this pull request follow one or more existing packages? Answering is optional.

This pull request followed these packages:

  • constants/float16/pi, constants/float16/two-pi, constants/float16/ln-pi

What carried over from the reference(s)?

  • Source layout of lib/index.js (// MAIN // and // EXPORTS // only) and assigning the value as a float16-exact literal.

What differed, or what did you have to work out yourself?

  • Nothing.

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

Namespace summary. constants/float16 has 53 members, none autogenerated. Features analyzed: file tree, package.json key sets, README section lists and order, manifest.json presence, test/benchmark/example file names, lib/index.js section layout, JSDoc tag sequence, runtime dependencies, and @type values. The namespace is structurally uniform: all 53 share the same base file set and the same package.json keys. Features without a clear 75% majority were excluded: C APIs/manifest.json (15/53), @type value (36/53 number), and README intro/notes sections.

Validation. Features were extracted from the filesystem and source by script, and the candidates went through three independent review passes: semantic (intentional or not), cross-reference (whether tests, examples or docs rely on the current shape), and structural (whether the majority layout applies). All three confirmed both changes. ninf and pinf keep their // MODULES // sections, because they need @stdlib/number/ctor.

Deliberately excluded:

  • 12 packages without a @see tag. The links differ from package to package, so this is not a mechanical fix.
  • 11 packages with one blank line, not two, after the module header. This is whitespace only.

Checklist

Please ensure the following tasks are completed before submitting this pull request.

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of AI assistance?

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

If you answered "yes" to using AI assistance, please provide a short disclosure indicating how you used AI assistance. This helps reviewers determine how much scrutiny to apply when reviewing your contribution. Example disclosures: "This PR was written primarily by Claude Code." or "I consulted ChatGPT to understand the codebase, but the proposed changes were fully authored manually by myself.".

This PR was written primarily by Claude Code, as part of an automated cross-package drift-detection routine.


@stdlib-js/reviewers


Generated by Claude Code

Removed the runtime `@stdlib/number/float64/base/to-float16` dependency
and assigned the float16-exact literal `9.8671875` directly. The value is
exactly representable in half-precision, so the conversion was a no-op.
Every other `constants/float16` package declares its value without a
conversion call (52/53, 98%), and only `ninf` and `pinf` have a
`// MODULES //` section, for `@stdlib/number/ctor` (49/53 have none, 92%).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wWD77tffwzMPSzZL1VPAF
Removed a `// MODULES //` section that held only a leftover comment from
a removed conversion import. No other `constants/float16` package has a
modules section without a `require` (52/53, 98%), and 49/53 (92%) use
only `// MAIN //` and `// EXPORTS //` sections.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wWD77tffwzMPSzZL1VPAF
@stdlib-bot

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
constants/float16/ln-two-pi $\\color{green}51/51$
$\\color{green}+100.00\\%$
$\\color{green}1/1$
$\\color{green}+100.00\\%$
$\\color{green}0/0$
$\\color{green}+100.00\\%$
$\\color{green}51/51$
$\\color{green}+100.00\\%$
constants/float16/pi-squared $\\color{green}48/48$
$\\color{green}+100.00\\%$
$\\color{green}1/1$
$\\color{green}+100.00\\%$
$\\color{green}0/0$
$\\color{green}+100.00\\%$
$\\color{green}48/48$
$\\color{green}+100.00\\%$

The above coverage report was generated for the changes in this PR.

@kgryte
kgryte marked this pull request as ready for review November 21, 2026 23:25
@kgryte
kgryte requested a review from a team November 21, 2026 23:25
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Nov 21, 2026
@kgryte
kgryte merged commit 942eaea into develop Nov 21, 2026
34 checks passed
@kgryte
kgryte deleted the claude/cool-johnson-ccuz5z branch November 21, 2026 23:26
@kgryte kgryte removed the Needs Review A pull request which needs code review. label Nov 21, 2026
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.

4 participants