From 506b402f378936e0a1af1aa1952fcbee36ff180d Mon Sep 17 00:00:00 2001 From: Philipp Burckhardt Date: Tue, 2 Jun 2026 17:37:51 -0500 Subject: [PATCH] docs: fix TSDoc issues in several `@stdlib/math/base/tools` declarations Correct documentation-only issues flagged by an audit of the `@stdlib/math/base/tools` namespace: - `chebyshev-series` / `chebyshev-seriesf`: remove the misleading inline `// 1*T_0(1/2) + 0.5*T_1(1/2)` example comments, which evaluate to 1.25 and contradict the correct `// returns 0.75` annotations (the coefficients are stored in descending-degree order with constant-term half-weighting). Also drop the result-style comment misplaced on the `factory(...)` construction line, which returns an evaluator function. - `evalrational` / `evalrationalf`: correct off-by-one polynomial-degree labels in the examples (a degree-3 polynomial was labeled "degree 4" and a degree-1 polynomial "degree 2"). - `hermitepoly` / `normhermitepoly` / `normhermitepolyf`: add the "nonnegative" qualifier to the `factory` method's `@param n` so it matches the call-signature `@param n` in the same file. This PR addresses only the TypeScript declaration files. --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown_pkg_readmes status: na - task: lint_markdown_docs status: na - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed --- --- .../math/base/tools/chebyshev-series/docs/types/index.d.ts | 6 +++--- .../math/base/tools/chebyshev-seriesf/docs/types/index.d.ts | 6 +++--- .../math/base/tools/evalrational/docs/types/index.d.ts | 4 ++-- .../math/base/tools/evalrationalf/docs/types/index.d.ts | 4 ++-- .../math/base/tools/hermitepoly/docs/types/index.d.ts | 2 +- .../math/base/tools/normhermitepoly/docs/types/index.d.ts | 2 +- .../math/base/tools/normhermitepolyf/docs/types/index.d.ts | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/node_modules/@stdlib/math/base/tools/chebyshev-series/docs/types/index.d.ts b/lib/node_modules/@stdlib/math/base/tools/chebyshev-series/docs/types/index.d.ts index 2873e8324570..40d538ddfc40 100644 --- a/lib/node_modules/@stdlib/math/base/tools/chebyshev-series/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/math/base/tools/chebyshev-series/docs/types/index.d.ts @@ -49,7 +49,7 @@ interface ChebyshevSeries { * @returns evaluated Chebyshev series * * @example - * var v = chebyshevSeries( 1.0, [ 1.0, 0.5 ] ); // 1*T_0(1/2) + 0.5*T_1(1/2) + * var v = chebyshevSeries( 1.0, [ 1.0, 0.5 ] ); * // returns 0.75 */ ( x: number, c: Collection ): number; @@ -91,11 +91,11 @@ interface ChebyshevSeries { * @returns evaluated Chebyshev series * * @example -* var v = chebyshevSeries( 1.0, [ 1.0, 0.5 ] ); // 1*T_0(1/2) + 0.5*T_1(1/2) +* var v = chebyshevSeries( 1.0, [ 1.0, 0.5 ] ); * // returns 0.75 * * @example -* var evaluate = chebyshevSeries.factory( [ 1.0, 0.5 ] ); // 1*T_0(1/2) + 0.5*T_1(1/2) +* var evaluate = chebyshevSeries.factory( [ 1.0, 0.5 ] ); * * var v = evaluate( 1.0 ); * // returns 0.75 diff --git a/lib/node_modules/@stdlib/math/base/tools/chebyshev-seriesf/docs/types/index.d.ts b/lib/node_modules/@stdlib/math/base/tools/chebyshev-seriesf/docs/types/index.d.ts index 4e9de0f34813..10f1f9df0c73 100644 --- a/lib/node_modules/@stdlib/math/base/tools/chebyshev-seriesf/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/math/base/tools/chebyshev-seriesf/docs/types/index.d.ts @@ -51,7 +51,7 @@ interface ChebyshevSeries { * @example * var Float32Array = require( '@stdlib/array/float32' ); * - * var v = chebyshevSeriesf( 1.0, new Float32Array( [ 1.0, 0.5 ] ) ); // 1*T_0(1/2) + 0.5*T_1(1/2) + * var v = chebyshevSeriesf( 1.0, new Float32Array( [ 1.0, 0.5 ] ) ); * // returns 0.75 */ ( x: number, c: Collection ): number; @@ -97,13 +97,13 @@ interface ChebyshevSeries { * @example * var Float32Array = require( '@stdlib/array/float32' ); * -* var v = chebyshevSeriesf( 1.0, new Float32Array( [ 1.0, 0.5 ] ) ); // 1*T_0(1/2) + 0.5*T_1(1/2) +* var v = chebyshevSeriesf( 1.0, new Float32Array( [ 1.0, 0.5 ] ) ); * // returns 0.75 * * @example * var Float32Array = require( '@stdlib/array/float32' ); * -* var evaluate = chebyshevSeriesf.factory( new Float32Array( [ 1.0, 0.5 ] ) ); // 1*T_0(1/2) + 0.5*T_1(1/2) +* var evaluate = chebyshevSeriesf.factory( new Float32Array( [ 1.0, 0.5 ] ) ); * * var v = evaluate( 1.0 ); * // returns 0.75 diff --git a/lib/node_modules/@stdlib/math/base/tools/evalrational/docs/types/index.d.ts b/lib/node_modules/@stdlib/math/base/tools/evalrational/docs/types/index.d.ts index 9d80cae62395..5338dda5b74f 100644 --- a/lib/node_modules/@stdlib/math/base/tools/evalrational/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/math/base/tools/evalrational/docs/types/index.d.ts @@ -57,10 +57,10 @@ interface EvalRational { * // returns -6.0 * * @example - * // 2x^3 + 4x^2 - 5x^1 - 6x^0 => degree 4 + * // 2x^3 + 4x^2 - 5x^1 - 6x^0 => degree 3 * var P = [ -6.0, -5.0, 4.0, 2.0 ]; * - * // 0.5x^1 + 3x^0 => degree 2 + * // 0.5x^1 + 3x^0 => degree 1 * var Q = [ 3.0, 0.5, 0.0, 0.0 ]; // zero-padded * * var v = evalrational( P, Q, 6.0 ); // => ( -6*6^0 - 5*6^1 + 4*6^2 + 2*6^3 ) / ( 3*6^0 + 0.5*6^1 + 0*6^2 + 0*6^3 ) = (-6-30+144+432)/(3+3) diff --git a/lib/node_modules/@stdlib/math/base/tools/evalrationalf/docs/types/index.d.ts b/lib/node_modules/@stdlib/math/base/tools/evalrationalf/docs/types/index.d.ts index ddcff6bad714..ba1a8166b513 100644 --- a/lib/node_modules/@stdlib/math/base/tools/evalrationalf/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/math/base/tools/evalrationalf/docs/types/index.d.ts @@ -61,10 +61,10 @@ interface EvalRational { * @example * var Float32Array = require( '@stdlib/array/float32' ); * - * // 2x^3 + 4x^2 - 5x^1 - 6x^0 => degree 4 + * // 2x^3 + 4x^2 - 5x^1 - 6x^0 => degree 3 * var P = new Float32Array( [ -6.0, -5.0, 4.0, 2.0 ] ); * - * // 0.5x^1 + 3x^0 => degree 2 + * // 0.5x^1 + 3x^0 => degree 1 * var Q = new Float32Array( [ 3.0, 0.5, 0.0, 0.0 ] ); // zero-padded * * var v = evalrationalf( P, Q, 6.0 ); // => ( -6*6^0 - 5*6^1 + 4*6^2 + 2*6^3 ) / ( 3*6^0 + 0.5*6^1 + 0*6^2 + 0*6^3 ) = (-6-30+144+432)/(3+3) diff --git a/lib/node_modules/@stdlib/math/base/tools/hermitepoly/docs/types/index.d.ts b/lib/node_modules/@stdlib/math/base/tools/hermitepoly/docs/types/index.d.ts index 73ddb08af122..68403be3ed7c 100644 --- a/lib/node_modules/@stdlib/math/base/tools/hermitepoly/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/math/base/tools/hermitepoly/docs/types/index.d.ts @@ -64,7 +64,7 @@ interface Hermitepoly { /** * Returns a function for evaluating a physicist's Hermite polynomial. * - * @param n - polynomial degree + * @param n - nonnegative polynomial degree * @returns function for evaluating a physicist's Hermite polynomial * * @example diff --git a/lib/node_modules/@stdlib/math/base/tools/normhermitepoly/docs/types/index.d.ts b/lib/node_modules/@stdlib/math/base/tools/normhermitepoly/docs/types/index.d.ts index 9e0c434e280b..ec93a3fd3b50 100644 --- a/lib/node_modules/@stdlib/math/base/tools/normhermitepoly/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/math/base/tools/normhermitepoly/docs/types/index.d.ts @@ -60,7 +60,7 @@ interface NormHermitePoly { /** * Returns a function for evaluating a normalized Hermite polynomial using double-precision floating-point arithmetic. * - * @param n - polynomial degree + * @param n - nonnegative polynomial degree * @returns function for evaluating a normalized Hermite polynomial * * @example diff --git a/lib/node_modules/@stdlib/math/base/tools/normhermitepolyf/docs/types/index.d.ts b/lib/node_modules/@stdlib/math/base/tools/normhermitepolyf/docs/types/index.d.ts index 92a0da9998f2..8cea4f43fdff 100644 --- a/lib/node_modules/@stdlib/math/base/tools/normhermitepolyf/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/math/base/tools/normhermitepolyf/docs/types/index.d.ts @@ -60,7 +60,7 @@ interface NormHermitePoly { /** * Returns a function for evaluating a normalized Hermite polynomial using single-precision floating-point arithmetic. * - * @param n - polynomial degree + * @param n - nonnegative polynomial degree * @returns function for evaluating a normalized Hermite polynomial * * @example