Skip to content

docs: fix truncating format specifiers in math/base/* examples - #16734

Merged
kgryte merged 1 commit into
developfrom
claude/trusting-cannon-eiarhm
Nov 21, 2026
Merged

kgryte merged 1 commit into
developfrom
claude/trusting-cannon-eiarhm

Conversation

@Planeshifter

Copy link
Copy Markdown
Member

Description

What is the purpose of this pull request?

This pull request:

  • propagates fixes merged to develop between 2026-11-19 and 2026-11-20 to sibling packages.
  • propagates c62ed72 ("docs: clean-up"), which replaced %d with %0.4f for non-integer values in logEachMap examples. string/format truncates %d to an integer, so floor2( 0.3 ) prints 0 instead of 0.2500, and sincospif( -0.5 ) is labeled sincospif(0). Affected packages (README and examples/index.js):
    • math/base/special/floor2 (output)
    • math/base/special/floor10 (output)
    • math/base/tools/chebyshev-series (input and output)
    • math/base/special/fresnelf (input)
    • math/base/special/sincospif (input)

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:

  • number/float64/base/div
  • math/base/special/ceil2

What carried over from the reference(s)?

  • %0.4f for non-integer values in logEachMap format strings. floor2 and floor10 now match ceil2, round2, trunc2, ceil10, round10, and trunc10.

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

  • For chebyshev-series, fresnelf, and sincospif, the inputs are drawn from random/array/uniform, so the input specifier is also changed.

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.

Validation: candidate sites came from searching all logEachMap/logEach format strings that use %d in examples/index.js and READMEs, then checking the random generator and the function's range at each one. Two independent validation passes read every file in full and ran each example to see the truncated output. An adaptation pass and a style-consistency pass checked the patches against sibling packages. Every site was confirmed by all four passes.

Excluded:

  • console.log( '...%d...' ) sites (e.g., ceilb, floorn, the chebyshev-series direct-evaluation loop), because Node's util.format does not truncate %d.
  • stats/base/dists/planck/cdf %04f. This is a different defect (zero-padded width, not precision).
  • Other candidates from the same window:

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 fix-propagation routine.


@stdlib-js/reviewers


Generated by Claude Code

Propagates fix from c62ed72 ("docs: clean-up") to sibling packages whose
`logEachMap` examples print non-integer values using `%d`, which
`string/format` truncates to an integer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wWD79FxccmCVj6eLT63Lk
@stdlib-bot stdlib-bot added Math Issue or pull request specific to math functionality. Good First PR A pull request resolving a Good First Issue. labels Nov 20, 2026
@stdlib-bot

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
math/base/special/floor10 $\\color{green}193/193$
$\\color{green}+100.00\\%$
$\\color{green}19/19$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}193/193$
$\\color{green}+100.00\\%$
math/base/special/floor2 $\\color{green}193/193$
$\\color{green}+100.00\\%$
$\\color{green}19/19$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}193/193$
$\\color{green}+100.00\\%$
math/base/special/fresnelf $\\color{red}565/569$
$\\color{green}+99.30\\%$
$\\color{red}28/30$
$\\color{green}+93.33\\%$
$\\color{green}7/7$
$\\color{green}+100.00\\%$
$\\color{red}565/569$
$\\color{green}+99.30\\%$
math/base/special/sincospif $\\color{green}475/475$
$\\color{green}+100.00\\%$
$\\color{green}54/54$
$\\color{green}+100.00\\%$
$\\color{green}3/3$
$\\color{green}+100.00\\%$
$\\color{green}475/475$
$\\color{green}+100.00\\%$
math/base/tools/chebyshev-series $\\color{green}280/280$
$\\color{green}+100.00\\%$
$\\color{green}20/20$
$\\color{green}+100.00\\%$
$\\color{green}3/3$
$\\color{green}+100.00\\%$
$\\color{green}280/280$
$\\color{green}+100.00\\%$

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

@kgryte kgryte added the Documentation Improvements, additions, or changes to documentation. label Nov 21, 2026
@kgryte
kgryte marked this pull request as ready for review November 21, 2026 23:35
@kgryte
kgryte requested a review from a team November 21, 2026 23:35
@kgryte
kgryte merged commit 4f37391 into develop Nov 21, 2026
68 checks passed
@kgryte
kgryte deleted the claude/trusting-cannon-eiarhm branch November 21, 2026 23:37
@stdlib-bot stdlib-bot added Needs Review A pull request which needs code review. and removed Needs Review A pull request which needs code review. labels Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation Improvements, additions, or changes to documentation. Good First PR A pull request resolving a Good First Issue. Math Issue or pull request specific to math functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants