Skip to content

Commit

Permalink
docs: update descriptions and add structured package data
Browse files Browse the repository at this point in the history
PR-URL: #2914
Ref: #1147
Co-authored-by: Athan Reines <kgryte@gmail.com>
Reviewed-by: Athan Reines <kgryte@gmail.com> 
Signed-off-by: Athan Reines <kgryte@gmail.com>
  • Loading branch information
gunjjoshi and kgryte authored Sep 17, 2024
1 parent 08f39b4 commit 0c994ee
Show file tree
Hide file tree
Showing 8 changed files with 147 additions and 23 deletions.
4 changes: 2 additions & 2 deletions lib/node_modules/@stdlib/math/base/special/gcd/docs/repl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
Parameters
----------
a: integer
First integer.
First number.

b: integer
Second integer.
Second number.

Returns
-------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
* - If both `a` and `b` are `0`, the function returns `0`.
* - Both `a` and `b` must have integer values; otherwise, the function returns `NaN`.
*
* @param a - integer
* @param b - integer
* @param a - first number
* @param b - second number
* @returns greatest common divisor
*
* @example
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
* [@stein:1967]: https://doi.org/10.1016/0021-9991(67)90047-2
*
* @private
* @param {integer} a - integer
* @param {integer} b - integer
* @param {integer} a - first number
* @param {integer} b - second number
* @returns {integer} greatest common divisor
*
* @example
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
* [@stein:1967]: https://doi.org/10.1016/0021-9991(67)90047-2
*
* @private
* @param {integer32} a - integer
* @param {integer32} b - integer
* @param {integer32} a - first number
* @param {integer32} b - second number
* @returns {integer32} greatest common divisor
*
* @example
Expand Down
4 changes: 2 additions & 2 deletions lib/node_modules/@stdlib/math/base/special/gcd/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ var largeIntegers = require( './binary_gcd.js' );
/**
* Computes the greatest common divisor (gcd).
*
* @param {integer} a - integer
* @param {integer} b - integer
* @param {integer} a - first number
* @param {integer} b - second number
* @returns {integer} greatest common divisor
*
* @example
Expand Down
6 changes: 3 additions & 3 deletions lib/node_modules/@stdlib/math/base/special/gcd/lib/native.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ var addon = require( './../src/addon.node' );
* Computes the greatest common divisor (gcd).
*
* @private
* @param {number} a - input value
* @param {number} b - input value
* @returns {number} function value
* @param {number} a - first number
* @param {number} b - second number
* @returns {number} greatest common divisor
*
* @example
* var v = gcd( 0.0, 0.0 );
Expand Down
126 changes: 125 additions & 1 deletion lib/node_modules/@stdlib/math/base/special/gcd/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,129 @@
"gcm",
"arithmetic",
"integer"
]
],
"__stdlib__": {
"scaffold": {
"$schema": "math/base@v1.0",
"base_alias": "gcd",
"alias": "gcd",
"pkg_desc": "compute the greatest common divisor (gcd)",
"desc": "computes the greatest common divisor (gcd)",
"short_desc": "greatest common divisor (gcd)",
"parameters": [
{
"name": "a",
"desc": "first number",
"type": {
"javascript": "integer",
"jsdoc": "integer",
"c": "double",
"dtype": "float64"
},
"domain": [
{
"min": "-infinity",
"max": "infinity"
}
],
"rand": {
"prng": "random/base/discrete-uniform",
"parameters": [
0.0,
50.0
]
},
"example_values": [
1.0,
2.0,
4.0,
5.0,
9.0,
10.0,
15.0,
20.0,
21.0,
25.0,
28.0,
30.0,
33.0,
35.0,
39.0,
40.0,
42.0,
45.0,
48.0,
50.0
]
},
{
"name": "b",
"desc": "second number",
"type": {
"javascript": "integer",
"jsdoc": "integer",
"c": "double",
"dtype": "float64"
},
"domain": [
{
"min": "-infinity",
"max": "infinity"
}
],
"rand": {
"prng": "random/base/discrete-uniform",
"parameters": [
0.0,
50.0
]
},
"example_values": [
1.0,
2.0,
4.0,
5.0,
9.0,
10.0,
15.0,
20.0,
21.0,
25.0,
28.0,
30.0,
33.0,
35.0,
39.0,
40.0,
42.0,
45.0,
48.0,
50.0
]
}
],
"returns": {
"desc": "greatest common divisor",
"type": {
"javascript": "number",
"jsdoc": "number",
"c": "double",
"dtype": "float64"
}
},
"keywords": [
"binary gcd",
"greatest common divisor",
"greatest common factor",
"highest common factor",
"greatest common measure",
"highest common divisor",
"gcd",
"gcf",
"hcf",
"gcm"
],
"extra_keywords": []
}
}
}
18 changes: 9 additions & 9 deletions lib/node_modules/@stdlib/math/base/special/gcd/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ static const int64_t STDLIB_CONSTANT_INT64_MAX = 9223372036854775807;
/**
* Computes the greatest common divisor (gcd) using the binary GCD algorithm.
*
* @param a input value
* @param b input value
* @return output value
* @param a first number
* @param b second number
* @return greatest common divisor
*
* @example
* double out = largeIntegers( 1.2676506002282294.0e+30, 9007199254740992.0 );
Expand Down Expand Up @@ -86,9 +86,9 @@ static double largeIntegers( const double a, const double b ) {
/**
* Computes the greatest common divisor (gcd) using the binary GCD algorithm and bitwise operations.
*
* @param a input value
* @param b input value
* @return output value
* @param a first number
* @param b second number
* @return greatest common divisor
*
* @example
* double out = bitwise( 48.0, 18.0 );
Expand Down Expand Up @@ -142,9 +142,9 @@ static double bitwise( const double a, const double b ) {
/**
* Computes the greatest common divisor (gcd).
*
* @param a input value
* @param b input value
* @return output value
* @param a first number
* @param b second number
* @return greatest common divisor
*
* @example
* double out = stdlib_base_gcd( 48.0, 18.0 );
Expand Down

1 comment on commit 0c994ee

@stdlib-bot
Copy link
Contributor

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/special/gcd $\color{green}336/336$
$\color{green}+100.00\%$
$\color{green}53/53$
$\color{green}+100.00\%$
$\color{green}4/4$
$\color{green}+100.00\%$
$\color{green}336/336$
$\color{green}+100.00\%$

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

Please sign in to comment.