Skip to content

docs: fix return annotations in bernoullif and pareto-type1/logcdf - #16992

Merged
kgryte merged 2 commits into
developfrom
claude/trusting-cannon-j1som8
Nov 30, 2026
Merged

kgryte merged 2 commits into
developfrom
claude/trusting-cannon-j1som8

Conversation

@Planeshifter

Copy link
Copy Markdown
Member

Description

What is the purpose of this pull request?

This pull request:

  • propagates cfa768d ("docs: fix return annotation in math/base/special/bernoulli") to math/base/special/bernoullif. The lib/index.js example for bernoullif( 2 ) truncated 1/6 to ~0.166; every other doc in the package already reads ~0.167.
  • propagates 757c4d1 ("chore: fix JavaScript lint errors") to stats/base/dists/pareto-type1/logcdf. The lib/native.js example for logcdf( +Infinity, 4.0, 2.0 ) annotated 0.0, but log1p( -0.0 ) returns -0.0, which matches lib/main.js, lib/index.js, and README.md.

Related Issues

Does this pull request have any related issues?

No.

Reference Packages

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

This pull request followed these packages:

  • math/base/special/bernoulli
  • stats/base/dists/weibull/logcdf

What carried over from the reference(s)?

  • The one-line annotation corrections, applied verbatim.

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.

Propagates fixes merged to develop between 2026-11-28 23:38 and 2026-11-29 13:04 (UTC+1) to sibling packages. Two independent validation passes and a style pass confirmed each site.

Deliberately excluded:

  • 83d96bf (array/base/logspace, length === 1): array/base/linspace shows the same two-element output, but its README states that length is assumed to be >= 2. array/base/linspace2d returns [ [ NaN ] ] for a 1x1 shape. Both need a maintainer decision.
  • 041090e / a77504b (string/base/uppercase): fixing more sites would add new dependencies.
  • 98e305a, e5d18df (lint suppressions, trailing whitespace): these do not change behavior or any user-visible text.
  • pareto-type1/logcdf docs/types/index.d.ts and docs/repl.txt also annotate 0.0 for the +Infinity case. That is outside the source commit's file scope and is left for a follow-up.

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 cfa768d ("docs: fix return annotation in `math/base/special/bernoulli`") to the single-precision sibling, whose `lib/index.js` example for `bernoullif( 2 )` truncated 1/6 to `~0.166` instead of rounding to `~0.167`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wWD7A4y7FfYn43n9DEFxn
…ogcdf`

Propagates fix from 757c4d1 ("chore: fix JavaScript lint errors") to `stats/base/dists/pareto-type1/logcdf`, whose `lib/native.js` example for `logcdf( +Infinity, 4.0, 2.0 )` annotated `0.0` although `log1p( -0.0 )` returns `-0.0`.

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

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
math/base/special/bernoullif $\\color{green}240/240$
$\\color{green}+100.00\\%$
$\\color{green}16/16$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}240/240$
$\\color{green}+100.00\\%$
stats/base/dists/pareto-type1/logcdf $\\color{green}327/327$
$\\color{green}+100.00\\%$
$\\color{green}25/25$
$\\color{green}+100.00\\%$
$\\color{green}4/4$
$\\color{green}+100.00\\%$
$\\color{green}327/327$
$\\color{green}+100.00\\%$

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why -0.0, 0 is same in positive & negative

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

0.0 and -0.0 compare equal under ===, but they are distinct IEEE 754 values (Object.is( -0.0, 0.0 ) is false, and 1.0/-0.0 is -Infinity). stdlib doctest annotations distinguish signed zeros, so // returns 0.0 asserts a positive zero.

Here the implementation returns log1p( -pow( beta/x, alpha ) ). For x = +Infinity, that is log1p( -0.0 ), which is -0.0. lib/main.js, lib/index.js, and README.md already annotate -0.0, and 757c4d1 made the same correction in stats/base/dists/weibull/logcdf/lib/native.js.


Generated by Claude Code

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Floating-point zero can be signed.

@kgryte kgryte added the Documentation Improvements, additions, or changes to documentation. label Nov 30, 2026
@kgryte
kgryte marked this pull request as ready for review November 30, 2026 08:49
@kgryte
kgryte requested a review from a team November 30, 2026 08:49
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Nov 30, 2026
@kgryte
kgryte merged commit 70d5a6e into develop Nov 30, 2026
50 checks passed
@kgryte
kgryte deleted the claude/trusting-cannon-j1som8 branch November 30, 2026 08:50
@kgryte kgryte removed the Needs Review A pull request which needs code review. label Nov 30, 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants