Skip to content

Commit 9bdb8b6

Browse files
committed
feat: update number/uint32/base TypeScript declarations
--- 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 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: na - task: lint_license_headers status: passed ---
1 parent 7e901bd commit 9bdb8b6

File tree

1 file changed

+113
-0
lines changed
  • lib/node_modules/@stdlib/number/uint32/base/docs/types

1 file changed

+113
-0
lines changed

lib/node_modules/@stdlib/number/uint32/base/docs/types/index.d.ts

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,46 @@
2020

2121
/* eslint-disable max-lines */
2222

23+
import add = require( '@stdlib/number/uint32/base/add' );
2324
import fromBinaryStringUint32 = require( '@stdlib/number/uint32/base/from-binary-string' );
25+
import identity = require( '@stdlib/number/uint32/base/identity' );
26+
import mul = require( '@stdlib/number/uint32/base/mul' );
27+
import muldw = require( '@stdlib/number/uint32/base/muldw' );
2428
import rotl32 = require( '@stdlib/number/uint32/base/rotl' );
2529
import rotr32 = require( '@stdlib/number/uint32/base/rotr' );
30+
import sub = require( '@stdlib/number/uint32/base/sub' );
2631
import toBinaryStringUint32 = require( '@stdlib/number/uint32/base/to-binary-string' );
2732
import uint32ToInt32 = require( '@stdlib/number/uint32/base/to-int32' );
2833

2934
/**
3035
* Interface describing the `base` namespace.
3136
*/
3237
interface Namespace {
38+
/**
39+
* Computes the sum of two unsigned 32-bit integers `x` and `y`.
40+
*
41+
* ## Notes
42+
*
43+
* - The function performs C-like addition of two unsigned 32-bit integers, including wraparound semantics.
44+
*
45+
* @param x - first input value
46+
* @param y - second input value
47+
* @returns sum
48+
*
49+
* @example
50+
* var v = ns.add( 1>>>0, 5>>>0 );
51+
* // returns 6
52+
*
53+
* @example
54+
* var v = ns.add( 2>>>0, 5>>>0 );
55+
* // returns 7
56+
*
57+
* @example
58+
* var v = ns.add( 0>>>0, 5>>>0 );
59+
* // returns 5
60+
*/
61+
add: typeof add;
62+
3363
/**
3464
* Creates an unsigned 32-bit integer from a literal bit representation.
3565
*
@@ -59,6 +89,64 @@ interface Namespace {
5989
*/
6090
fromBinaryStringUint32: typeof fromBinaryStringUint32;
6191

92+
/**
93+
* Evaluates the identity function for an unsigned 32-bit integer `x`.
94+
*
95+
* @param x - input value
96+
* @returns input value
97+
*
98+
* @example
99+
* var v = ns.identity( 1 );
100+
* // returns 1
101+
*
102+
* @example
103+
* var v = ns.identity( 2 );
104+
* // returns 2
105+
*
106+
* @example
107+
* var v = ns.identity( 0 );
108+
* // returns 0
109+
*
110+
* @example
111+
* var v = ns.identity( 4294967295 );
112+
* // returns 4294967295
113+
*/
114+
identity: typeof identity;
115+
116+
/**
117+
* Multiples two unsigned 32-bit integers.
118+
*
119+
* ## Notes
120+
*
121+
* - The function performs C-like multiplication of two unsigned 32-bit integers, including wraparound semantics.
122+
*
123+
* @param x - first input value
124+
* @param y - second input value
125+
* @returns result
126+
*
127+
* @example
128+
* var v = ns.mul( 10>>>0, 4>>>0 );
129+
* // returns 40
130+
*/
131+
mul: typeof mul;
132+
133+
/**
134+
* Performs multiplication of two unsigned 32-bit integers and returns an array of two unsigned 32-bit integers which represents the unsigned 64-bit integer product.
135+
*
136+
* ## Notes
137+
*
138+
* - When computing the product of 32-bit integer values in double-precision floating-point format (the default JavaScript numeric data type), computing the double word product is necessary in order to avoid exceeding the maximum safe double-precision floating-point integer value.
139+
*
140+
* @param a - integer
141+
* @param b - integer
142+
* @returns double word product (in big endian order; i.e., the first element corresponds to the most significant bits and the second element to the least significant bits)
143+
*
144+
* @example
145+
* var v = ns.muldw( 0xAAAAAAAA, 0x55555555 );
146+
* // returns [ 954437176, 1908874354 ]
147+
*/
148+
muldw: typeof muldw;
149+
62150
/**
63151
* Performs a bitwise rotation to the left.
64152
*
@@ -115,6 +203,31 @@ interface Namespace {
115203
*/
116204
rotr32: typeof rotr32;
117205

206+
/**
207+
* Subtracts two unsigned 32-bit integers `x` and `y`.
208+
*
209+
* ## Notes
210+
*
211+
* - The function performs C-like subtraction of two unsigned 32-bit integers, including wraparound semantics.
212+
*
213+
* @param x - first input value
214+
* @param y - second input value
215+
* @returns result
216+
*
217+
* @example
218+
* var v = ns.sub( 5>>>0, 1>>>0 );
219+
* // returns 4
220+
*
221+
* @example
222+
* var v = ns.sub( 5>>>0, 2>>>0 );
223+
* // returns 3
224+
*
225+
* @example
226+
* var v = ns.sub( 5>>>0, 0>>>0 );
227+
* // returns 5
228+
*/
229+
sub: typeof sub;
230+
118231
/**
119232
* Returns a string giving the literal bit representation of an unsigned 32-bit integer.
120233
*

0 commit comments

Comments
 (0)