Repository navigation
docs: fix return annotations in bernoullif and pareto-type1/logcdf - #16992
Conversation
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
Coverage Report
The above coverage report was generated for the changes in this PR. |
There was a problem hiding this comment.
why -0.0, 0 is same in positive & negative
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Floating-point zero can be signed.
Description
This pull request:
math/base/special/bernoulli") tomath/base/special/bernoullif. Thelib/index.jsexample forbernoullif( 2 )truncated 1/6 to~0.166; every other doc in the package already reads~0.167.stats/base/dists/pareto-type1/logcdf. Thelib/native.jsexample forlogcdf( +Infinity, 4.0, 2.0 )annotated0.0, butlog1p( -0.0 )returns-0.0, which matcheslib/main.js,lib/index.js, andREADME.md.Related Issues
No.
Reference Packages
This pull request followed these packages:
math/base/special/bernoullistats/base/dists/weibull/logcdfQuestions
No.
Other
Propagates fixes merged to
developbetween 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:
array/base/logspace,length === 1):array/base/linspaceshows the same two-element output, but its README states thatlengthis assumed to be>= 2.array/base/linspace2dreturns[ [ NaN ] ]for a1x1shape. Both need a maintainer decision.string/base/uppercase): fixing more sites would add new dependencies.pareto-type1/logcdfdocs/types/index.d.tsanddocs/repl.txtalso annotate0.0for the+Infinitycase. That is outside the source commit's file scope and is left for a follow-up.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/reviewersGenerated by Claude Code