Skip to content

Commit

Permalink
feat: update namespace TypeScript declarations
Browse files Browse the repository at this point in the history
PR-URL: 	#1134
Reviewed-by: Athan Reines <[email protected]> 
Co-authored-by: Philipp Burckhardt <[email protected]>
  • Loading branch information
stdlib-bot and Planeshifter authored Nov 20, 2023
1 parent f204b3f commit 5c48417
Show file tree
Hide file tree
Showing 2 changed files with 180 additions and 0 deletions.
151 changes: 151 additions & 0 deletions lib/node_modules/@stdlib/math/base/ops/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,19 @@
/* eslint-disable max-lines */

import add = require( '@stdlib/math/base/ops/add' );
import add3 = require( '@stdlib/math/base/ops/add3' );
import addf = require( '@stdlib/math/base/ops/addf' );
import cadd = require( '@stdlib/math/base/ops/cadd' );
import caddf = require( '@stdlib/math/base/ops/caddf' );
import cdiv = require( '@stdlib/math/base/ops/cdiv' );
import cmul = require( '@stdlib/math/base/ops/cmul' );
import cmulf = require( '@stdlib/math/base/ops/cmulf' );
import cneg = require( '@stdlib/math/base/ops/cneg' );
import cnegf = require( '@stdlib/math/base/ops/cnegf' );
import csub = require( '@stdlib/math/base/ops/csub' );
import csubf = require( '@stdlib/math/base/ops/csubf' );
import div = require( '@stdlib/math/base/ops/div' );
import divf = require( '@stdlib/math/base/ops/divf' );
import imul = require( '@stdlib/math/base/ops/imul' );
import imuldw = require( '@stdlib/math/base/ops/imuldw' );
import mul = require( '@stdlib/math/base/ops/mul' );
Expand Down Expand Up @@ -72,6 +76,36 @@ interface Namespace {
*/
add: typeof add;

/**
* Computes the sum of three double-precision floating-point numbers.
*
* @param x - first input value
* @param y - second input value
* @param z - third input value
* @returns sum
*
* @example
* var v = ns.add3( -1.0, 5.0, 2.0 );
* // returns 6.0
*
* @example
* var v = ns.add3( 2.0, 5.0, 2.0 );
* // returns 9.0
*
* @example
* var v = ns.add3( 0.0, 5.0, 2.0 );
* // returns 7.0
*
* @example
* var v = ns.add3( -0.0, 0.0, -0.0 );
* // returns 0.0
*
* @example
* var v = ns.add3( NaN, NaN, NaN );
* // returns NaN
*/
add3: typeof add3;

/**
* Computes the sum of two single-precision floating-point numbers `x` and `y`.
*
Expand Down Expand Up @@ -299,6 +333,65 @@ interface Namespace {
*/
cneg: typeof cneg;

/**
* Negates a single-precision complex floating-point number.
*
* @param z - complex number
* @returns result
*
* @example
* var Complex64 = require( `@stdlib/complex/float32` );
* var realf = require( `@stdlib/complex/realf` );
* var imagf = require( `@stdlib/complex/imagf` );
*
* var z = new Complex64( -4.2, 5.5 );
* // returns <Complex64>
*
* var out = ns.cnegf( z );
* // returns <Complex64>
*
* var re = realf( out );
* // returns 4.2
*
* var im = imagf( out );
* // returns -5.5
*
* @example
* var Complex64 = require( `@stdlib/complex/float32` );
* var realf = require( `@stdlib/complex/realf` );
* var imagf = require( `@stdlib/complex/imagf` );
*
* var z = new Complex64( 0.0, 0.0 );
* // returns <Complex64>
*
* var out = ns.cnegf( z );
* // returns <Complex64>
*
* var re = realf( out );
* // returns -0.0
*
* var im = imagf( out );
* // returns -0.0
*
* @example
* var Complex64 = require( `@stdlib/complex/float32` );
* var realf = require( `@stdlib/complex/realf` );
* var imagf = require( `@stdlib/complex/imagf` );
*
* var z = new Complex64( NaN, NaN );
* // returns <Complex64>
*
* var out = ns.cnegf( z );
* // returns <Complex64>
*
* var re = realf( out );
* // returns NaN
*
* var im = imagf( out );
* // returns NaN
*/
cnegf: typeof cnegf;

/**
* Subtracts two double-precision complex floating-point numbers.
*
Expand Down Expand Up @@ -357,6 +450,64 @@ interface Namespace {
*/
csubf: typeof csubf;

/**
* Divides two double-precision floating-point numbers `x` and `y`.
*
* @param x - first input value (divided)
* @param y - second input value (divisor)
* @returns result
*
* @example
* var v = ns.div( -1.0, 5.0 );
* // returns -0.2
*
* @example
* var v = ns.div( 2.0, 5.0 );
* // returns 0.4
*
* @example
* var v = ns.div( 0.0, 5.0 );
* // returns 0.0
*
* @example
* var v = ns.div( -0.0, 5.0 );
* // returns -0.0
*
* @example
* var v = ns.div( NaN, NaN );
* // returns NaN
*/
div: typeof div;

/**
* Divides two single-precision floating-point numbers `x` and `y`.
*
* @param x - first input value (divided)
* @param y - second input value (divisor)
* @returns result
*
* @example
* var v = ns.divf( -1.0, 5.0 );
* // returns ~-0.2
*
* @example
* var v = ns.divf( 2.0, 5.0 );
* // returns ~0.4
*
* @example
* var v = ns.divf( 0.0, 5.0 );
* // returns 0.0
*
* @example
* var v = ns.divf( -0.0, 5.0 );
* // returns -0.0
*
* @example
* var v = ns.divf( NaN, NaN );
* // returns NaN
*/
divf: typeof divf;

/**
* Performs C-like multiplication of two signed 32-bit integers.
*
Expand Down
29 changes: 29 additions & 0 deletions lib/node_modules/@stdlib/math/base/special/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ import expit = require( '@stdlib/math/base/special/expit' );
import expm1 = require( '@stdlib/math/base/special/expm1' );
import expm1rel = require( '@stdlib/math/base/special/expm1rel' );
import factorial = require( '@stdlib/math/base/special/factorial' );
import factorial2 = require( '@stdlib/math/base/special/factorial2' );
import factorialln = require( '@stdlib/math/base/special/factorialln' );
import fallingFactorial = require( '@stdlib/math/base/special/falling-factorial' );
import fast = require( '@stdlib/math/base/special/fast' );
Expand Down Expand Up @@ -3031,6 +3032,34 @@ interface Namespace {
*/
factorial: typeof factorial;

/**
* Evaluates the double factorial of `n`.
*
* @param n - input value
* @returns double factorial
*
* @example
* var v = ns.factorial2( 3 );
* // returns 3
*
* @example
* var v = ns.factorial2( 4 );
* // returns 8
*
* @example
* var v = ns.factorial2( -10 );
* // returns NaN
*
* @example
* var v = ns.factorial2( 301 );
* // returns Infinity
*
* @example
* var v = ns.factorial2( NaN );
* // returns NaN
*/
factorial2: typeof factorial2;

/**
* Evaluates the natural logarithm of the factorial of `x`.
*
Expand Down

1 comment on commit 5c48417

@stdlib-bot
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Coverage Report

Package Statements Branches Functions Lines
math/base/ops $\color{green}240/240$
$\color{green}+100.00\%$
$\color{green}1/1$
$\color{green}+100.00\%$
$\color{green}0/0$
$\color{green}+100.00\%$
$\color{green}240/240$
$\color{green}+100.00\%$
math/base/special $\color{green}2103/2103$
$\color{green}+100.00\%$
$\color{green}1/1$
$\color{green}+100.00\%$
$\color{green}0/0$
$\color{green}+100.00\%$
$\color{green}2103/2103$
$\color{green}+100.00\%$

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

Please sign in to comment.