Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update descriptions and add structured package data for math/base/special/gcd #2914

Merged
merged 3 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading