diff --git a/lib/node_modules/@stdlib/random/base/pcg32/README.md b/lib/node_modules/@stdlib/random/base/pcg32/README.md
new file mode 100644
index 000000000000..69681c8ce2ee
--- /dev/null
+++ b/lib/node_modules/@stdlib/random/base/pcg32/README.md
@@ -0,0 +1,323 @@
+
+
+
+
+# PCG32
+
+> A 32-bit permuted congruential pseudorandom number generator ([PCG][pcg]) based on O’Neill.
+
+
+
+## Usage
+
+```javascript
+var pcg32 = require( '@stdlib/random/base/pcg32' );
+```
+
+#### pcg32()
+
+Returns a pseudorandom integer on the interval `[0, 4294967295]`.
+
+```javascript
+var r = pcg32();
+// returns
+```
+
+#### pcg32.normalized()
+
+Returns a pseudorandom number on the interval `[0,1)`.
+
+```javascript
+var r = pcg32.normalized();
+// returns
+```
+
+#### pcg32.factory( \[options] )
+
+Returns a 32-bit permuted congruential pseudorandom number generator ([PCG][pcg]).
+
+```javascript
+var rand = pcg32.factory();
+```
+
+The function accepts the following `options`:
+
+- **seed**: pseudorandom number generator seed.
+- **state**: an [`Uint32Array`][@stdlib/array/uint32] containing pseudorandom number generator state. If provided, the function ignores the `seed` option.
+- **copy**: `boolean` indicating whether to copy a provided pseudorandom number generator state. Setting this option to `false` allows sharing state between two or more pseudorandom number generators. Setting this option to `true` ensures that a returned generator has exclusive control over its internal state. Default: `true`.
+
+By default, a random integer is used to seed the returned generator. To seed the generator, provide either an `integer` on the interval `[0, 4294967295]`
+
+```javascript
+var rand = pcg32.factory({
+ 'seed': 1234
+});
+
+var r = rand();
+// returns 2653504168
+```
+
+or, for arbitrary length seeds, an array-like `object` containing 32-bit unsigned integers
+
+```javascript
+var Uint32Array = require( '@stdlib/array/uint32' );
+
+var rand = pcg32.factory({
+ 'seed': new Uint32Array( [ 1234 ] )
+});
+
+var r = rand();
+// returns 2653504168
+```
+
+To return a generator having a specific initial state, set the generator `state` option.
+
+```javascript
+// Generate pseudorandom numbers, thus progressing the generator state:
+var r;
+var i;
+for ( i = 0; i < 1000; i++ ) {
+ r = pcg32();
+}
+
+// Create a new PRNG initialized to the current state of `pcg32`:
+var rand = pcg32.factory({
+ 'state': pcg32.state
+});
+
+// Test that the generated pseudorandom numbers are the same:
+var bool = ( rand() === pcg32() );
+// returns true
+```
+
+#### pcg32.NAME
+
+The generator name.
+
+```javascript
+var str = pcg32.NAME;
+// returns 'pcg32'
+```
+
+#### pcg32.MIN
+
+Minimum possible value.
+
+```javascript
+var min = pcg32.MIN;
+// returns 0
+```
+
+#### pcg32.MAX
+
+Maximum possible value.
+
+```javascript
+var max = pcg32.MAX;
+// returns 4294967295
+```
+
+#### pcg32.seed
+
+The value used to seed `pcg32()`.
+
+```javascript
+// Generate pseudorandom values...
+var r;
+var i;
+for ( i = 0; i < 100; i++ ) {
+ r = pcg32();
+}
+
+// Generate the same pseudorandom values...
+var rand = pcg32.factory({
+ 'seed': pcg32.seed
+});
+for ( i = 0; i < 100; i++ ) {
+ r = rand();
+}
+```
+
+#### pcg32.seedLength
+
+Length of generator seed.
+
+```javascript
+var len = pcg32.seedLength;
+// returns
+```
+
+#### pcg32.state
+
+Writable property for getting and setting the generator state.
+
+```javascript
+var r = pcg32();
+// returns
+
+r = pcg32();
+// returns
+
+// ...
+
+// Get the current state:
+var state = pcg32.state;
+// returns
+
+r = pcg32();
+// returns
+
+r = pcg32();
+// returns
+
+// Reset the state:
+pcg32.state = state;
+
+// Replay the last two pseudorandom numbers:
+r = pcg32();
+// returns
+
+r = pcg32();
+// returns
+
+// ...
+```
+
+#### pcg32.stateLength
+
+Length of generator state.
+
+```javascript
+var len = pcg32.stateLength;
+// returns
+```
+
+#### pcg32.byteLength
+
+Size (in bytes) of generator state.
+
+```javascript
+var sz = pcg32.byteLength;
+// returns
+```
+
+#### pcg32.toJSON()
+
+Serializes the pseudorandom number generator as a JSON object.
+
+```javascript
+var o = pcg32.toJSON();
+// returns { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }
+```
+
+
+
+
+
+
+
+## Notes
+
+- The generator has a period of `2^64`.
+- A [PCG][pcg] is fast, compact, and has excellent statistical quality compared to classic [LCG][lcg]s. It uses a simple [LCG][lcg] under the hood but applies permutation steps to improve output randomness. While it's not cryptographically secure, it's well-suited for most non-crypto tasks like simulations or procedural generation.
+- If PRNG state is "shared" (meaning a state array was provided during PRNG creation and **not** copied) and one sets the generator state to a state array having a different length, the PRNG does **not** update the existing shared state and, instead, points to the newly provided state array. In order to synchronize PRNG output according to the new shared state array, the state array for **each** relevant PRNG must be **explicitly** set.
+- If PRNG state is "shared" and one sets the generator state to a state array of the same length, the PRNG state is updated (along with the state of all other PRNGs sharing the PRNG's state array).
+
+
+
+
+
+
+
+## Examples
+
+
+
+```javascript
+var pcg32 = require( '@stdlib/random/base/pcg32' );
+
+// Generate pseudorandom numbers...
+var i;
+for ( i = 0; i < 100; i++ ) {
+ console.log( pcg32() );
+}
+
+// Create a new pseudorandom number generator...
+var seed = 1234;
+var rand = pcg32.factory({
+ 'seed': seed
+});
+for ( i = 0; i < 100; i++ ) {
+ console.log( rand() );
+}
+
+// Create another pseudorandom number generator using a previous seed...
+rand = pcg32.factory({
+ 'seed': pcg32.seed
+});
+for ( i = 0; i < 100; i++ ) {
+ console.log( rand() );
+}
+```
+
+
+
+
+
+* * *
+
+
+
+## References
+
+- O’Neill, Melissa E. 2014. “PCG: A Family of Simple Fast Space-Efficient Statistically Good Algorithms for Random Number Generation.” Technical Report HMC-CS-2014-0905. Harvey Mudd College, Claremont, CA. [https://www.cs.hmc.edu/tr/hmc-cs-2014-0905.pdf][@oneill:2014].
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+[pcg]: https://en.wikipedia.org/wiki/Permuted_congruential_generator
+
+[lcg]: https://en.wikipedia.org/wiki/Linear_congruential_generator
+
+[@oneill:2014]: https://www.cs.hmc.edu/tr/hmc-cs-2014-0905.pdf
+
+[@stdlib/array/uint32]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/uint32
+
+
+
+
+
+
+
+
diff --git a/lib/node_modules/@stdlib/random/base/pcg32/benchmark/benchmark.factory.js b/lib/node_modules/@stdlib/random/base/pcg32/benchmark/benchmark.factory.js
new file mode 100644
index 000000000000..76362e0d6c26
--- /dev/null
+++ b/lib/node_modules/@stdlib/random/base/pcg32/benchmark/benchmark.factory.js
@@ -0,0 +1,106 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2026 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+'use strict';
+
+// MODULES //
+
+var bench = require( '@stdlib/bench' );
+var Uint32Array = require( '@stdlib/array/uint32' );
+var isnan = require( '@stdlib/math/base/assert/is-nan' );
+var minstd = require( '@stdlib/random/base/minstd-shuffle' );
+var format = require( '@stdlib/string/format' );
+var pkg = require( './../package.json' ).name;
+var factory = require( './../lib' ).factory;
+
+
+// MAIN //
+
+bench( format( '%s:factory', pkg ), function benchmark( b ) {
+ var f;
+ var i;
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ f = factory();
+ if ( typeof f !== 'function' ) {
+ b.fail( 'should return a function' );
+ }
+ }
+ b.toc();
+ if ( isnan( f() ) ) {
+ b.fail( 'should not return NaN' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+});
+
+bench( format( '%s:factory:seed=', pkg ), function benchmark( b ) {
+ var opts;
+ var f;
+ var i;
+
+ opts = {
+ 'seed': 1
+ };
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ opts.seed += i;
+ f = factory( opts );
+ if ( typeof f !== 'function' ) {
+ b.fail( 'should return a function' );
+ }
+ }
+ b.toc();
+ if ( isnan( f() ) ) {
+ b.fail( 'should not return NaN' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+});
+
+bench( format( '%s:factory:seed=', pkg ), function benchmark( b ) {
+ var seed;
+ var opts;
+ var f;
+ var i;
+
+ opts = {};
+
+ seed = new Uint32Array( 10 );
+ for ( i = 0; i < seed.length; i++ ) {
+ seed[ i ] = minstd();
+ }
+ opts.seed = seed;
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ opts.seed[ 0 ] = i + 1;
+ f = factory( opts );
+ if ( typeof f !== 'function' ) {
+ b.fail( 'should return a function' );
+ }
+ }
+ b.toc();
+ if ( isnan( f() ) ) {
+ b.fail( 'should not return NaN' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+});
diff --git a/lib/node_modules/@stdlib/random/base/pcg32/benchmark/benchmark.js b/lib/node_modules/@stdlib/random/base/pcg32/benchmark/benchmark.js
new file mode 100644
index 000000000000..fcb94a4e05ba
--- /dev/null
+++ b/lib/node_modules/@stdlib/random/base/pcg32/benchmark/benchmark.js
@@ -0,0 +1,68 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2026 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+'use strict';
+
+// MODULES //
+
+var bench = require( '@stdlib/bench' );
+var isnan = require( '@stdlib/math/base/assert/is-nan' );
+var format = require( '@stdlib/string/format' );
+var pkg = require( './../package.json' ).name;
+var pcg32 = require( './../lib' );
+
+
+// MAIN //
+
+bench( pkg, function benchmark( b ) {
+ var z;
+ var i;
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ z = pcg32();
+ if ( isnan( z ) ) {
+ b.fail( 'should not return NaN' );
+ }
+ }
+ b.toc();
+ if ( isnan( z ) ) {
+ b.fail( 'should not return NaN' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+});
+
+bench( format( '%s:normalized', pkg ), function benchmark( b ) {
+ var z;
+ var i;
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ z = pcg32.normalized();
+ if ( isnan( z ) ) {
+ b.fail( 'should not return NaN' );
+ }
+ }
+ b.toc();
+ if ( isnan( z ) ) {
+ b.fail( 'should not return NaN' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+});
diff --git a/lib/node_modules/@stdlib/random/base/pcg32/benchmark/benchmark.to_json.js b/lib/node_modules/@stdlib/random/base/pcg32/benchmark/benchmark.to_json.js
new file mode 100644
index 000000000000..fecf6b0817da
--- /dev/null
+++ b/lib/node_modules/@stdlib/random/base/pcg32/benchmark/benchmark.to_json.js
@@ -0,0 +1,49 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2026 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+'use strict';
+
+// MODULES //
+
+var bench = require( '@stdlib/bench' );
+var isObject = require( '@stdlib/assert/is-plain-object' );
+var format = require( '@stdlib/string/format' );
+var pkg = require( './../package.json' ).name;
+var rand = require( './../lib' );
+
+
+// MAIN //
+
+bench( format( '%s:toJSON', pkg ), function benchmark( b ) {
+ var o;
+ var i;
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ o = rand.toJSON();
+ if ( typeof o !== 'object' ) {
+ b.fail( 'should return an object' );
+ }
+ }
+ b.toc();
+ if ( !isObject( o ) ) {
+ b.fail( 'should return an object' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+});
diff --git a/lib/node_modules/@stdlib/random/base/pcg32/benchmark/c/Makefile b/lib/node_modules/@stdlib/random/base/pcg32/benchmark/c/Makefile
new file mode 100644
index 000000000000..e790d7bffa7f
--- /dev/null
+++ b/lib/node_modules/@stdlib/random/base/pcg32/benchmark/c/Makefile
@@ -0,0 +1,146 @@
+#/
+# @license Apache-2.0
+#
+# Copyright (c) 2026 The Stdlib Authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#/
+
+# VARIABLES #
+
+ifndef VERBOSE
+ QUIET := @
+else
+ QUIET :=
+endif
+
+# Determine the OS ([1][1], [2][2]).
+#
+# [1]: https://en.wikipedia.org/wiki/Uname#Examples
+# [2]: http://stackoverflow.com/a/27776822/2225624
+OS ?= $(shell uname)
+ifneq (, $(findstring MINGW,$(OS)))
+ OS := WINNT
+else
+ifneq (, $(findstring MSYS,$(OS)))
+ OS := WINNT
+else
+ifneq (, $(findstring CYGWIN,$(OS)))
+ OS := WINNT
+else
+ifneq (, $(findstring Windows_NT,$(OS)))
+ OS := WINNT
+endif
+endif
+endif
+endif
+
+# Define the program used for compiling C source files:
+ifdef C_COMPILER
+ CC := $(C_COMPILER)
+else
+ CC := gcc
+endif
+
+# Define the command-line options when compiling C files:
+CFLAGS ?= \
+ -std=c99 \
+ -O3 \
+ -Wall \
+ -pedantic
+
+# Determine whether to generate position independent code ([1][1], [2][2]).
+#
+# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options
+# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option
+ifeq ($(OS), WINNT)
+ fPIC ?=
+else
+ fPIC ?= -fPIC
+endif
+
+# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`):
+INCLUDE ?=
+
+# List of source files:
+SOURCE_FILES ?=
+
+# List of libraries (e.g., `-lopenblas -lpthread`):
+LIBRARIES ?=
+
+# List of library paths (e.g., `-L /foo/bar -L /beep/boop`):
+LIBPATH ?=
+
+# List of C targets:
+c_targets := benchmark.out
+
+
+# RULES #
+
+#/
+# Compiles C source files.
+#
+# @param {string} SOURCE_FILES - list of C source files
+# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop`)
+# @param {string} [LIBRARIES] - list of libraries (e.g., `-lpthread -lblas`)
+# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`)
+# @param {string} [C_COMPILER] - C compiler
+# @param {string} [CFLAGS] - C compiler flags
+# @param {(string|void)} [fPIC] - compiler flag indicating whether to generate position independent code
+#
+# @example
+# make
+#
+# @example
+# make all
+#/
+all: $(c_targets)
+
+.PHONY: all
+
+#/
+# Compiles C source files.
+#
+# @private
+# @param {string} SOURCE_FILES - list of C source files
+# @param {(string|void)} INCLUDE - list of includes (e.g., `-I /foo/bar -I /beep/boop`)
+# @param {(string|void)} LIBRARIES - list of libraries (e.g., `-lpthread -lblas`)
+# @param {(string|void)} LIBPATH - list of library paths (e.g., `-L /foo/bar -L /beep/boop`)
+# @param {string} CC - C compiler
+# @param {string} CFLAGS - C compiler flags
+# @param {(string|void)} fPIC - compiler flag indicating whether to generate position independent code
+#/
+$(c_targets): %.out: %.c
+ $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES)
+
+#/
+# Runs compiled benchmarks.
+#
+# @example
+# make run
+#/
+run: $(c_targets)
+ $(QUIET) ./$<
+
+.PHONY: run
+
+#/
+# Removes generated files.
+#
+# @example
+# make clean
+#/
+clean:
+ $(QUIET) -rm -f *.o *.out
+
+.PHONY: clean
diff --git a/lib/node_modules/@stdlib/random/base/pcg32/benchmark/c/benchmark.c b/lib/node_modules/@stdlib/random/base/pcg32/benchmark/c/benchmark.c
new file mode 100644
index 000000000000..7bbbba6279f9
--- /dev/null
+++ b/lib/node_modules/@stdlib/random/base/pcg32/benchmark/c/benchmark.c
@@ -0,0 +1,401 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2026 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#include "stdlib/random/base/pcg32.h"
+#include "stdlib/random/base/shared.h"
+#include
+#include
+#include
+#include
+#include
+#include
+
+#define NAME "base/pcg32"
+#define ITERATIONS 1000000
+#define REPEATS 3
+
+/**
+* Prints the TAP version.
+*/
+static void print_version( void ) {
+ printf( "TAP version 13\n" );
+}
+
+/**
+* Prints the TAP summary.
+*
+* @param total total number of tests
+* @param passing total number of passing tests
+*/
+static void print_summary( int total, int passing ) {
+ printf( "#\n" );
+ printf( "1..%d\n", total ); // TAP plan
+ printf( "# total %d\n", total );
+ printf( "# pass %d\n", passing );
+ printf( "#\n" );
+ printf( "# ok\n" );
+}
+
+/**
+* Prints benchmarks results.
+*
+* @param elapsed elapsed time in seconds
+*/
+static void print_results( double elapsed ) {
+ double rate = (double)ITERATIONS / elapsed;
+ printf( " ---\n" );
+ printf( " iterations: %d\n", ITERATIONS );
+ printf( " elapsed: %0.9f\n", elapsed );
+ printf( " rate: %0.9f\n", rate );
+ printf( " ...\n" );
+}
+
+/**
+* Returns a clock time.
+*
+* @return clock time
+*/
+static double tic( void ) {
+ struct timeval now;
+ gettimeofday( &now, NULL );
+ return (double)now.tv_sec + (double)now.tv_usec/1.0e6;
+}
+
+/**
+* Generates a random number on the interval [0,1).
+*
+* @return random number
+*/
+static double rand_double( void ) {
+ int r = rand();
+ return (double)r / ( (double)RAND_MAX + 1.0 );
+}
+
+/**
+* Runs a benchmark.
+*
+* @return elapsed time in seconds
+*/
+static double benchmark1( void ) {
+ uint32_t seed[1];
+ double elapsed;
+ double t;
+ int i;
+
+ struct BasePRNGObject *obj;
+
+ t = tic();
+ for ( i = 0; i < ITERATIONS; i++ ) {
+ seed[ 0 ] = i + 1;
+ obj = stdlib_base_random_pcg32_allocate( seed, 1 );
+ if ( obj == NULL || obj->prng->min != 1 ) {
+ printf( "unexpected result\n" );
+ break;
+ }
+ if ( i < ITERATIONS-1 ) {
+ stdlib_base_random_pcg32_free( obj );
+ }
+ }
+ elapsed = tic() - t;
+
+ if ( obj == NULL || obj->prng->min != 1 ) {
+ printf( "unexpected result\n" );
+ }
+ stdlib_base_random_pcg32_free( obj );
+
+ return elapsed;
+}
+
+/**
+* Runs a benchmark.
+*
+* @return elapsed time in seconds
+*/
+static double benchmark2( void ) {
+ uint32_t seed[1];
+ double elapsed;
+ int8_t status;
+ uint64_t max;
+ uint64_t v;
+ double t;
+ int i;
+
+ seed[ 0 ] = 1234;
+
+ struct BasePRNGObject *obj = stdlib_base_random_pcg32_allocate( seed, 1 );
+ if ( obj == NULL ) {
+ printf( "unable to allocate memory\n" );
+ exit( 1 );
+ }
+ max = obj->prng->max;
+
+ t = tic();
+ for ( i = 0; i < ITERATIONS; i++ ) {
+ status = obj->prng->next( obj, &v );
+ if ( status != 0 || v > max ) {
+ printf( "unexpected result\n" );
+ break;
+ }
+ }
+ elapsed = tic() - t;
+
+ if ( status != 0 || v > max ) {
+ printf( "unexpected result\n" );
+ }
+ stdlib_base_random_pcg32_free( obj );
+
+ return elapsed;
+}
+
+/**
+* Runs a benchmark.
+*
+* @return elapsed time in seconds
+*/
+static double benchmark3( void ) {
+ uint32_t seed[1];
+ double elapsed;
+ int8_t status;
+ double v;
+ double t;
+ int i;
+
+ seed[ 0 ] = 1234;
+
+ struct BasePRNGObject *obj = stdlib_base_random_pcg32_allocate( seed, 1 );
+ if ( obj == NULL ) {
+ printf( "unable to allocate memory\n" );
+ exit( 1 );
+ }
+
+ t = tic();
+ for ( i = 0; i < ITERATIONS; i++ ) {
+ status = obj->prng->normalized( obj, &v );
+ if ( status != 0 || v != v ) {
+ printf( "unexpected result\n" );
+ break;
+ }
+ }
+ elapsed = tic() - t;
+
+ if ( status != 0 || v != v ) {
+ printf( "unexpected result\n" );
+ }
+ stdlib_base_random_pcg32_free( obj );
+
+ return elapsed;
+}
+
+/**
+* Runs a benchmark.
+*
+* @return elapsed time in seconds
+*/
+static double benchmark4( void ) {
+ uint32_t seed[1];
+ double elapsed;
+ int8_t status;
+ int64_t len;
+ double t;
+ int i;
+
+ seed[ 0 ] = 1234;
+
+ struct BasePRNGObject *obj = stdlib_base_random_pcg32_allocate( seed, 1 );
+ if ( obj == NULL ) {
+ printf( "unable to allocate memory\n" );
+ exit( 1 );
+ }
+
+ t = tic();
+ for ( i = 0; i < ITERATIONS; i++ ) {
+ status = stdlib_base_random_pcg32_seed_length( obj, &len );
+ if ( status != 0 || len != 1 ) {
+ printf( "unexpected result\n" );
+ }
+ status = stdlib_base_random_pcg32_seed( obj, seed );
+ if ( status != 0 || seed[ 0 ] != 1234 ) {
+ printf( "unexpected result\n" );
+ break;
+ }
+ }
+ elapsed = tic() - t;
+
+ if ( status != 0 || len != 1 || seed[ 0 ] != 1234 ) {
+ printf( "unexpected result\n" );
+ }
+ stdlib_base_random_pcg32_free( obj );
+
+ return elapsed;
+}
+
+/**
+* Runs a benchmark.
+*
+* @return elapsed time in seconds
+*/
+static double benchmark5( void ) {
+ stdlib_base_random_pcg32_state_t *state;
+ uint32_t seed[1];
+ double elapsed;
+ double t;
+ int i;
+
+ seed[ 0 ] = 1234;
+
+ struct BasePRNGObject *obj = stdlib_base_random_pcg32_allocate( seed, 1 );
+ if ( obj == NULL ) {
+ printf( "unable to allocate memory\n" );
+ exit( 1 );
+ }
+
+ t = tic();
+ for ( i = 0; i < ITERATIONS; i++ ) {
+ state = stdlib_base_random_pcg32_state( obj );
+ if ( state == NULL ) {
+ printf( "unexpected result\n" );
+ break;
+ }
+ if ( i < ITERATIONS-1 ) {
+ free( state );
+ }
+ }
+ elapsed = tic() - t;
+
+ stdlib_base_random_pcg32_free( obj );
+ if ( state == NULL ) {
+ printf( "unexpected result\n" );
+ } else {
+ free( state->seed );
+ free( state );
+ }
+ return elapsed;
+}
+
+/**
+* Runs a benchmark.
+*
+* @return elapsed time in seconds
+*/
+static double benchmark6( void ) {
+ stdlib_base_random_pcg32_state_t *states[2];
+ uint32_t seed[1] = { };
+ double elapsed;
+ int8_t status;
+ double t;
+ int i;
+
+ seed[ 0 ] = 1234;
+
+ struct BasePRNGObject *obj = stdlib_base_random_pcg32_allocate( seed, 1 );
+ if ( obj == NULL ) {
+ printf( "unable to allocate memory\n" );
+ exit( 1 );
+ }
+ for ( i = 0; i < 2; i++ ) {
+ states[i] = (stdlib_base_random_pcg32_state_t *)malloc( sizeof( stdlib_base_random_pcg32_state_t ) );
+ if ( states[i] == NULL ) {
+ printf( "unable to allocate memory\n" );
+ exit( 1 );
+ }
+ states[i]->seed = (uint32_t *)malloc( sizeof( uint32_t )*1 );
+ states[i]->seed[ 0 ] = 1234;
+ states[i]->seed_length = 1;
+ states[i]->state = i;
+ states[i]->increment = 1;
+ }
+
+ t = tic();
+ for ( i = 0; i < ITERATIONS; i++ ) {
+ status = stdlib_base_random_pcg32_set( obj, (void *)states[i%2] );
+ if ( status != 0 ) {
+ printf( "unexpected result\n" );
+ break;
+ }
+ }
+ elapsed = tic() - t;
+
+ if ( status != 0 ) {
+ printf( "unexpected result\n" );
+ }
+ stdlib_base_random_pcg32_free( obj );
+ for ( i = 0; i < 2; i++ ) {
+ free( states[i] );
+ }
+
+ return elapsed;
+}
+
+/**
+* Main execution sequence.
+*/
+int main( void ) {
+ double elapsed;
+ int count;
+ int i;
+
+ count = 0;
+
+ // Use the current time to seed the random number generator:
+ srand( time( NULL ) );
+
+ print_version();
+ for ( i = 0; i < REPEATS; i++ ) {
+ count += 1;
+ printf( "# c::%s::instantiation\n", NAME );
+ elapsed = benchmark1();
+ print_results( elapsed );
+ printf( "ok %d benchmark finished\n", count );
+ }
+ for ( i = 0; i < REPEATS; i++ ) {
+ count += 1;
+ printf( "# c::%s:next\n", NAME );
+ elapsed = benchmark2();
+ print_results( elapsed );
+ printf( "ok %d benchmark finished\n", count );
+ }
+ for ( i = 0; i < REPEATS; i++ ) {
+ count += 1;
+ printf( "# c::%s:normalized\n", NAME );
+ elapsed = benchmark3();
+ print_results( elapsed );
+ printf( "ok %d benchmark finished\n", count );
+ }
+ for ( i = 0; i < REPEATS; i++ ) {
+ count += 1;
+ printf( "# c::%s::get:seed\n", NAME );
+ elapsed = benchmark4();
+ print_results( elapsed );
+ printf( "ok %d benchmark finished\n", count );
+ }
+ for ( i = 0; i < REPEATS; i++ ) {
+ count += 1;
+ printf( "# c::%s::get:state\n", NAME );
+ elapsed = benchmark5();
+ print_results( elapsed );
+ printf( "ok %d benchmark finished\n", count );
+ }
+ for ( i = 0; i < REPEATS; i++ ) {
+ count += 1;
+ printf( "# c::%s::set:state\n", NAME );
+ elapsed = benchmark6();
+ print_results( elapsed );
+ printf( "ok %d benchmark finished\n", count );
+ }
+ print_summary( count, count );
+}
diff --git a/lib/node_modules/@stdlib/random/base/pcg32/binding.gyp b/lib/node_modules/@stdlib/random/base/pcg32/binding.gyp
new file mode 100644
index 000000000000..0d6508a12e99
--- /dev/null
+++ b/lib/node_modules/@stdlib/random/base/pcg32/binding.gyp
@@ -0,0 +1,170 @@
+# @license Apache-2.0
+#
+# Copyright (c) 2026 The Stdlib Authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# A `.gyp` file for building a Node.js native add-on.
+#
+# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md
+# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md
+{
+ # List of files to include in this file:
+ 'includes': [
+ './include.gypi',
+ ],
+
+ # Define variables to be used throughout the configuration for all targets:
+ 'variables': {
+ # Target name should match the add-on export name:
+ 'addon_target_name%': 'addon',
+
+ # Set variables based on the host OS:
+ 'conditions': [
+ [
+ 'OS=="win"',
+ {
+ # Define the object file suffix:
+ 'obj': 'obj',
+ },
+ {
+ # Define the object file suffix:
+ 'obj': 'o',
+ }
+ ], # end condition (OS=="win")
+ ], # end conditions
+ }, # end variables
+
+ # Define compile targets:
+ 'targets': [
+
+ # Target to generate an add-on:
+ {
+ # The target name should match the add-on export name:
+ 'target_name': '<(addon_target_name)',
+
+ # Define dependencies:
+ 'dependencies': [],
+
+ # Define directories which contain relevant include headers:
+ 'include_dirs': [
+ # Local include directory:
+ '<@(include_dirs)',
+ ],
+
+ # List of source files:
+ 'sources': [
+ '<@(src_files)',
+ ],
+
+ # Settings which should be applied when a target's object files are used as linker input:
+ 'link_settings': {
+ # Define libraries:
+ 'libraries': [
+ '<@(libraries)',
+ ],
+
+ # Define library directories:
+ 'library_dirs': [
+ '<@(library_dirs)',
+ ],
+ },
+
+ # C/C++ compiler flags:
+ 'cflags': [
+ # Enable commonly used warning options:
+ '-Wall',
+
+ # Aggressive optimization:
+ '-O3',
+ ],
+
+ # C specific compiler flags:
+ 'cflags_c': [
+ # Specify the C standard to which a program is expected to conform:
+ '-std=c99',
+ ],
+
+ # C++ specific compiler flags:
+ 'cflags_cpp': [
+ # Specify the C++ standard to which a program is expected to conform:
+ '-std=c++11',
+ ],
+
+ # Linker flags:
+ 'ldflags': [],
+
+ # Apply conditions based on the host OS:
+ 'conditions': [
+ [
+ 'OS=="mac"',
+ {
+ # Linker flags:
+ 'ldflags': [
+ '-undefined dynamic_lookup',
+ '-Wl,-no-pie',
+ '-Wl,-search_paths_first',
+ ],
+ },
+ ], # end condition (OS=="mac")
+ [
+ 'OS!="win"',
+ {
+ # C/C++ flags:
+ 'cflags': [
+ # Generate platform-independent code:
+ '-fPIC',
+ ],
+ },
+ ], # end condition (OS!="win")
+ ], # end conditions
+ }, # end target <(addon_target_name)
+
+ # Target to copy a generated add-on to a standard location:
+ {
+ 'target_name': 'copy_addon',
+
+ # Declare that the output of this target is not linked:
+ 'type': 'none',
+
+ # Define dependencies:
+ 'dependencies': [
+ # Require that the add-on be generated before building this target:
+ '<(addon_target_name)',
+ ],
+
+ # Define a list of actions:
+ 'actions': [
+ {
+ 'action_name': 'copy_addon',
+ 'message': 'Copying addon...',
+
+ # Explicitly list the inputs in the command-line invocation below:
+ 'inputs': [],
+
+ # Declare the expected outputs:
+ 'outputs': [
+ '<(addon_output_dir)/<(addon_target_name).node',
+ ],
+
+ # Define the command-line invocation:
+ 'action': [
+ 'cp',
+ '<(PRODUCT_DIR)/<(addon_target_name).node',
+ '<(addon_output_dir)/<(addon_target_name).node',
+ ],
+ },
+ ], # end actions
+ }, # end target copy_addon
+ ], # end targets
+}
diff --git a/lib/node_modules/@stdlib/random/base/pcg32/docs/repl.txt b/lib/node_modules/@stdlib/random/base/pcg32/docs/repl.txt
new file mode 100644
index 000000000000..c5cb694810e2
--- /dev/null
+++ b/lib/node_modules/@stdlib/random/base/pcg32/docs/repl.txt
@@ -0,0 +1,186 @@
+
+{{alias}}()
+ Returns a pseudorandom integer on the interval `[0, 4294967295]`.
+
+ This pseudorandom number generator (PRNG) is a 32-bit permuted congruential
+ pseudorandom number generator (PCG) based on O’Neill.
+
+ The generator has a period of `2^64`.
+
+ A PCG is fast, compact, and has excellent statistical quality compared to
+ classic LCGs. It uses a simple LCG under the hood but applies permutation
+ steps to improve output randomness. While it's not cryptographically secure,
+ it's well-suited for most non-crypto tasks like simulations or procedural
+ generation.
+
+ Returns
+ -------
+ r: integer
+ Pseudorandom number.
+
+ Examples
+ --------
+ > var r = {{alias}}();
+
+
+{{alias}}.normalized()
+ Returns a pseudorandom number on the interval `[0,1)`.
+
+ Returns
+ -------
+ r: number
+ Pseudorandom number.
+
+ Examples
+ --------
+ > var r = {{alias}}.normalized();
+
+
+{{alias}}.factory( [options] )
+ Returns a 32-bit permuted congruential pseudorandom number generator (PCG).
+
+ Parameters
+ ----------
+ options: Object (optional)
+ Options.
+
+ options.seed: integer|ArrayLikeObject (optional)
+ Pseudorandom number generator seed. The seed may be either a 32-bit
+ unsigned integer or, for arbitrary length seeds, an array-like object
+ containing 32-bit unsigned integers.
+
+ options.state: Uint32Array (optional)
+ Pseudorandom number generator state. If provided, the `seed` option is
+ ignored.
+
+ options.copy: boolean (optional)
+ Boolean indicating whether to copy a provided pseudorandom number
+ generator state. Setting this option to `false` allows sharing state
+ between two or more pseudorandom number generators. Setting this option
+ to `true` ensures that a returned generator has exclusive control over
+ its internal state. Default: true.
+
+ Returns
+ -------
+ rand: Function
+ Pseudorandom number generator (PRNG).
+
+ Examples
+ --------
+ // Basic usage:
+ > var rand = {{alias}}.factory();
+ > r = rand();
+ > r = rand();
+
+ // Provide a seed:
+ > rand = {{alias}}.factory( { 'seed': 1234 } );
+ > r = rand()
+ 2653504168
+
+
+{{alias}}.NAME
+ Generator name.
+
+ Examples
+ --------
+ > var str = {{alias}}.NAME
+ 'pcg32'
+
+
+{{alias}}.MIN
+ Minimum possible value.
+
+ Examples
+ --------
+ > var v = {{alias}}.MIN
+ 0
+
+
+{{alias}}.MAX
+ Maximum possible value.
+
+ Examples
+ --------
+ > var v = {{alias}}.MAX
+ 4294967295
+
+
+{{alias}}.seed
+ Pseudorandom number generator seed.
+
+ Examples
+ --------
+ > var seed = {{alias}}.seed;
+
+
+{{alias}}.seedLength
+ Length of generator seed.
+
+ Examples
+ --------
+ > var len = {{alias}}.seedLength;
+
+
+{{alias}}.state
+ Generator state.
+
+ Examples
+ --------
+ > var r = {{alias}}()
+
+ > r = {{alias}}()
+
+ > r = {{alias}}()
+
+
+ // Get a copy of the current state:
+ > var state = {{alias}}.state
+
+
+ > r = {{alias}}()
+
+ > r = {{alias}}()
+
+
+ // Set the state:
+ > {{alias}}.state = state;
+
+ // Replay the last two pseudorandom numbers:
+ > r = {{alias}}()
+
+ > r = {{alias}}()
+
+
+
+{{alias}}.stateLength
+ Length of generator state.
+
+ Examples
+ --------
+ > var len = {{alias}}.stateLength;
+
+
+{{alias}}.byteLength
+ Size (in bytes) of generator state.
+
+ Examples
+ --------
+ > var sz = {{alias}}.byteLength;
+
+
+{{alias}}.toJSON()
+ Serializes the pseudorandom number generator as a JSON object.
+
+ Returns
+ -------
+ out: Object
+ JSON representation.
+
+ Examples
+ --------
+ > var o = {{alias}}.toJSON()
+ { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }
+
+ See Also
+ --------
+
diff --git a/lib/node_modules/@stdlib/random/base/pcg32/docs/types/index.d.ts b/lib/node_modules/@stdlib/random/base/pcg32/docs/types/index.d.ts
new file mode 100644
index 000000000000..16927f7f0c9b
--- /dev/null
+++ b/lib/node_modules/@stdlib/random/base/pcg32/docs/types/index.d.ts
@@ -0,0 +1,197 @@
+/*
+* @license Apache-2.0
+*
+* Copyright (c) 2026 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+// TypeScript Version: 4.1
+
+///
+
+import * as random from '@stdlib/types/random';
+
+/**
+* Interface defining `factory` options.
+*/
+interface Options {
+ /**
+ * Pseudorandom number generator seed.
+ */
+ seed?: random.PRNGSeedPCG32;
+
+ /**
+ * Pseudorandom number generator state.
+ */
+ state?: random.PRNGStatePCG32;
+
+ /**
+ * Specifies whether to copy a provided pseudorandom number generator state.
+ */
+ copy?: boolean;
+}
+
+/**
+* Interface for PRNG properties and methods.
+*/
+interface PRNG {
+ /**
+ * Generator name.
+ */
+ readonly NAME: string;
+
+ /**
+ * Minimum possible value.
+ */
+ readonly MIN: number;
+
+ /**
+ * Maximum possible value.
+ */
+ readonly MAX: number;
+
+ /**
+ * PRNG seed.
+ */
+ readonly seed: random.PRNGSeedPCG32;
+
+ /**
+ * PRNG seed length.
+ */
+ readonly seedLength: number;
+
+ /**
+ * PRNG state.
+ */
+ state: random.PRNGStatePCG32;
+
+ /**
+ * PRNG state length.
+ */
+ readonly stateLength: number;
+
+ /**
+ * PRNG state size (in bytes).
+ */
+ readonly byteLength: number;
+
+ /**
+ * Serializes the pseudorandom number generator as a JSON object.
+ *
+ * @returns JSON representation
+ */
+ toJSON(): string;
+}
+
+/**
+* Interface for generating pseudorandom integers on the interval `[0, 4294967295]`.
+*/
+interface NullaryFunction extends PRNG {
+ /**
+ * Returns a pseudorandom integer on the interval `[0, 4294967295]`.
+ *
+ * @returns pseudorandom number
+ */
+ (): number;
+}
+
+/**
+* Interface for generating pseudorandom integers on the interval `[0, 4294967295]`.
+*/
+interface Random extends PRNG {
+ /**
+ * Returns a pseudorandom integer on the interval `[0, 4294967295]`.
+ *
+ * ## Notes
+ *
+ * - This pseudorandom number generator (PRNG) is a 32-bit permuted congruential pseudorandom number generator (PCG) based on O’Neill.
+ * - The generator has a period of `2^64`.
+ * - A PCG is fast, compact, and has excellent statistical quality compared to classic LCGs. It uses a simple LCG under the hood but applies permutation steps to improve output randomness. While it's not cryptographically secure, it's well-suited for most non-crypto tasks like simulations or procedural generation.
+ *
+ * @returns pseudorandom number
+ *
+ * @example
+ * var v = pcg32();
+ * // returns
+ */
+ (): number;
+
+ /**
+ * Returns a pseudorandom number on the interval `[0,1)`.
+ *
+ * @returns pseudorandom number
+ *
+ * @example
+ * var r = pcg32.normalized();
+ * // returns
+ */
+ normalized(): number;
+
+ /**
+ * Returns a 32-bit permuted congruential pseudorandom number generator (PCG).
+ *
+ * @param options - function options
+ * @param options.seed - pseudorandom number generator seed
+ * @param options.state - pseudorandom number generator state
+ * @param options.copy - boolean indicating whether to copy a provided pseudorandom number generator state (default: true)
+ * @throws must provide valid options
+ * @returns pseudorandom number generator
+ *
+ * @example
+ * var rand = pcg32.factory();
+ * var v = rand();
+ * // returns
+ *
+ * @example
+ * var rand = pcg32.factory({
+ * 'seed': 1234
+ * });
+ * var v = rand();
+ * // returns
+ */
+ factory( options?: Options ): NullaryFunction;
+}
+
+/**
+* Returns a pseudorandom integer on the interval `[0, 4294967295]`.
+*
+* ## Notes
+*
+* - This pseudorandom number generator (PRNG) is a 32-bit permuted congruential pseudorandom number generator (PCG) based on O’Neill.
+* - The generator has a period of `2^64`.
+* - A PCG is fast, compact, and has excellent statistical quality compared to classic LCGs. It uses a simple LCG under the hood but applies permutation steps to improve output randomness. While it's not cryptographically secure, it's well-suited for most non-crypto tasks like simulations or procedural generation.
+*
+* @returns pseudorandom number
+*
+* @example
+* var v = pcg32();
+* // returns
+*
+* @example
+* var v = pcg32.normalized();
+* // returns
+*
+* @example
+* var rand = pcg32.factory({
+* 'seed': 1234
+* });
+* var v = rand();
+* // returns
+*/
+declare var pcg32: Random;
+
+
+// EXPORTS //
+
+export = pcg32;
diff --git a/lib/node_modules/@stdlib/random/base/pcg32/docs/types/test.ts b/lib/node_modules/@stdlib/random/base/pcg32/docs/types/test.ts
new file mode 100644
index 000000000000..1aea266426ad
--- /dev/null
+++ b/lib/node_modules/@stdlib/random/base/pcg32/docs/types/test.ts
@@ -0,0 +1,106 @@
+/*
+* @license Apache-2.0
+*
+* Copyright (c) 2026 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+import pcg32 = require( './index' );
+
+
+// TESTS //
+
+// The function returns a number...
+{
+ pcg32(); // $ExpectType number
+}
+
+// The compiler throws an error if the function is provided any arguments...
+{
+ pcg32( true ); // $ExpectError
+ pcg32( 2, 3 ); // $ExpectError
+}
+
+// Attached to main export is a `normalized` method which returns a number...
+{
+ pcg32.normalized(); // $ExpectType number
+}
+
+// The compiler throws an error if the `normalized` method is provided any number of arguments...
+{
+ pcg32.normalized( true ); // $ExpectError
+ pcg32.normalized( 123 ); // $ExpectError
+ pcg32.normalized( 'abc' ); // $ExpectError
+}
+
+// Attached to main export is a `factory` method which returns a function...
+{
+ pcg32.factory(); // $ExpectType NullaryFunction
+ pcg32.factory( { 'copy': false } ); // $ExpectType NullaryFunction
+}
+
+// The `factory` method returns a function which returns a number...
+{
+ const fcn = pcg32.factory();
+ fcn(); // $ExpectType number
+}
+
+// The compiler throws an error if the function returned by the `factory` method is provided any number of arguments...
+{
+ const fcn = pcg32.factory();
+ fcn( 1 ); // $ExpectError
+ fcn( 2, 1 ); // $ExpectError
+ fcn( 2, 1, 1 ); // $ExpectError
+}
+
+// The compiler throws an error if the `factory` method is provided an options argument which is not an object...
+{
+ pcg32.factory( null ); // $ExpectError
+}
+
+// The compiler throws an error if the `factory` method is provided a `seed` option which is not a valid seed...
+{
+ pcg32.factory( { 'seed': true } ); // $ExpectError
+ pcg32.factory( { 'seed': 'abc' } ); // $ExpectError
+ pcg32.factory( { 'seed': null } ); // $ExpectError
+ pcg32.factory( { 'seed': [ 'a' ] } ); // $ExpectError
+ pcg32.factory( { 'seed': {} } ); // $ExpectError
+ pcg32.factory( { 'seed': ( x: number ): number => x } ); // $ExpectError
+}
+
+// The compiler throws an error if the `factory` method is provided a `state` option which is not a valid state...
+{
+ pcg32.factory( { 'state': 123 } ); // $ExpectError
+ pcg32.factory( { 'state': 'abc' } ); // $ExpectError
+ pcg32.factory( { 'state': null } ); // $ExpectError
+ pcg32.factory( { 'state': [] } ); // $ExpectError
+ pcg32.factory( { 'state': {} } ); // $ExpectError
+ pcg32.factory( { 'state': true } ); // $ExpectError
+ pcg32.factory( { 'state': ( x: number ): number => x } ); // $ExpectError
+}
+
+// The compiler throws an error if the `factory` method is provided a `copy` option which is not a boolean...
+{
+ pcg32.factory( { 'copy': 123 } ); // $ExpectError
+ pcg32.factory( { 'copy': 'abc' } ); // $ExpectError
+ pcg32.factory( { 'copy': null } ); // $ExpectError
+ pcg32.factory( { 'copy': [] } ); // $ExpectError
+ pcg32.factory( { 'copy': {} } ); // $ExpectError
+ pcg32.factory( { 'copy': ( x: number ): number => x } ); // $ExpectError
+}
+
+// The compiler throws an error if the `factory` method is provided more than one argument...
+{
+ pcg32.factory( {}, 2 ); // $ExpectError
+}
diff --git a/lib/node_modules/@stdlib/random/base/pcg32/examples/c/Makefile b/lib/node_modules/@stdlib/random/base/pcg32/examples/c/Makefile
new file mode 100644
index 000000000000..c8f8e9a1517b
--- /dev/null
+++ b/lib/node_modules/@stdlib/random/base/pcg32/examples/c/Makefile
@@ -0,0 +1,146 @@
+#/
+# @license Apache-2.0
+#
+# Copyright (c) 2026 The Stdlib Authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#/
+
+# VARIABLES #
+
+ifndef VERBOSE
+ QUIET := @
+else
+ QUIET :=
+endif
+
+# Determine the OS ([1][1], [2][2]).
+#
+# [1]: https://en.wikipedia.org/wiki/Uname#Examples
+# [2]: http://stackoverflow.com/a/27776822/2225624
+OS ?= $(shell uname)
+ifneq (, $(findstring MINGW,$(OS)))
+ OS := WINNT
+else
+ifneq (, $(findstring MSYS,$(OS)))
+ OS := WINNT
+else
+ifneq (, $(findstring CYGWIN,$(OS)))
+ OS := WINNT
+else
+ifneq (, $(findstring Windows_NT,$(OS)))
+ OS := WINNT
+endif
+endif
+endif
+endif
+
+# Define the program used for compiling C source files:
+ifdef C_COMPILER
+ CC := $(C_COMPILER)
+else
+ CC := gcc
+endif
+
+# Define the command-line options when compiling C files:
+CFLAGS ?= \
+ -std=c99 \
+ -O3 \
+ -Wall \
+ -pedantic
+
+# Determine whether to generate position independent code ([1][1], [2][2]).
+#
+# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options
+# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option
+ifeq ($(OS), WINNT)
+ fPIC ?=
+else
+ fPIC ?= -fPIC
+endif
+
+# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`):
+INCLUDE ?=
+
+# List of source files:
+SOURCE_FILES ?=
+
+# List of libraries (e.g., `-lopenblas -lpthread`):
+LIBRARIES ?=
+
+# List of library paths (e.g., `-L /foo/bar -L /beep/boop`):
+LIBPATH ?=
+
+# List of C targets:
+c_targets := example.out
+
+
+# RULES #
+
+#/
+# Compiles source files.
+#
+# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`)
+# @param {string} [CFLAGS] - C compiler options
+# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`)
+# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`)
+# @param {string} [SOURCE_FILES] - list of source files
+# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`)
+# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`)
+#
+# @example
+# make
+#
+# @example
+# make all
+#/
+all: $(c_targets)
+
+.PHONY: all
+
+#/
+# Compiles C source files.
+#
+# @private
+# @param {string} CC - C compiler (e.g., `gcc`)
+# @param {string} CFLAGS - C compiler options
+# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`)
+# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`)
+# @param {string} SOURCE_FILES - list of source files
+# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`)
+# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`)
+#/
+$(c_targets): %.out: %.c
+ $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES)
+
+#/
+# Runs compiled examples.
+#
+# @example
+# make run
+#/
+run: $(c_targets)
+ $(QUIET) ./$<
+
+.PHONY: run
+
+#/
+# Removes generated files.
+#
+# @example
+# make clean
+#/
+clean:
+ $(QUIET) -rm -f *.o *.out
+
+.PHONY: clean
diff --git a/lib/node_modules/@stdlib/random/base/pcg32/examples/c/example.c b/lib/node_modules/@stdlib/random/base/pcg32/examples/c/example.c
new file mode 100644
index 000000000000..0654ef2d6fc5
--- /dev/null
+++ b/lib/node_modules/@stdlib/random/base/pcg32/examples/c/example.c
@@ -0,0 +1,77 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2026 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#include "stdlib/random/base/pcg32.h"
+#include "stdlib/random/base/shared.h"
+#include
+#include
+#include
+
+int main( void ) {
+ int8_t status;
+ uint64_t v;
+ int32_t i;
+ double d;
+
+ // Define a seed:
+ uint32_t seed[] = { 1234 };
+
+ // Create a PRNG...
+ struct BasePRNGObject *obj = stdlib_base_random_pcg32_allocate( seed, 1 );
+ if ( obj == NULL ) {
+ fprintf( stderr, "Error allocating memory.\n" );
+ exit( 1 );
+ }
+
+ status = stdlib_base_random_pcg32_seed( obj, seed );
+ if ( status != 0 ) {
+ printf( "Unable to retrieve the PRNG seed.\n" );
+ exit( 1 );
+ }
+ printf( "seed = %d\n", seed[ 0 ] );
+
+ printf( "name = %s\n", obj->prng->name );
+ printf( "min = %"PRIu64"\n", obj->prng->min );
+ printf( "max = %"PRIu64"\n", obj->prng->max );
+
+ printf( "\nPseudorandom integers...\n" );
+ for ( i = 0; i < 10; i++ ) {
+ status = obj->prng->next( obj, &v );
+ if ( status != 0 ) {
+ printf( "Unexpected result.\n" );
+ exit( 1 );
+ }
+ printf( "%"PRIu64"\n", v );
+ }
+
+ printf( "\n" );
+ printf( "min (normalized) = %0.16f\n", obj->prng->normalized_min );
+ printf( "max (normalized) = %0.16f\n", obj->prng->normalized_max );
+
+ printf( "\nPseudorandom doubles...\n" );
+ for ( i = 0; i < 10; i++ ) {
+ status = obj->prng->normalized( obj, &d );
+ if ( status != 0 ) {
+ printf( "Unexpected result.\n" );
+ exit( 1 );
+ }
+ printf( "%0.16f\n", d );
+ }
+
+ stdlib_base_random_pcg32_free( obj );
+}
diff --git a/lib/node_modules/@stdlib/random/base/pcg32/examples/index.js b/lib/node_modules/@stdlib/random/base/pcg32/examples/index.js
new file mode 100644
index 000000000000..7aa0ad935af0
--- /dev/null
+++ b/lib/node_modules/@stdlib/random/base/pcg32/examples/index.js
@@ -0,0 +1,47 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2026 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+'use strict';
+
+var pcg32 = require( './../lib' );
+
+// Generate pseudorandom numbers...
+console.log( '\nseed: %d', pcg32.seed[ 0 ] );
+var i;
+for ( i = 0; i < 100; i++ ) {
+ console.log( pcg32() );
+}
+
+// Create a new pseudorandom number generator...
+var seed = 1234;
+var rand = pcg32.factory({
+ 'seed': seed
+});
+console.log( '\nseed: %d', seed );
+for ( i = 0; i < 100; i++ ) {
+ console.log( rand() );
+}
+
+// Create another pseudorandom number generator using a previous seed...
+rand = pcg32.factory({
+ 'seed': pcg32.seed
+});
+console.log( '\nseed: %d', rand.seed[ 0 ] );
+for ( i = 0; i < 100; i++ ) {
+ console.log( rand() );
+}
diff --git a/lib/node_modules/@stdlib/random/base/pcg32/include.gypi b/lib/node_modules/@stdlib/random/base/pcg32/include.gypi
new file mode 100644
index 000000000000..bee8d41a2caf
--- /dev/null
+++ b/lib/node_modules/@stdlib/random/base/pcg32/include.gypi
@@ -0,0 +1,53 @@
+# @license Apache-2.0
+#
+# Copyright (c) 2026 The Stdlib Authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# A GYP include file for building a Node.js native add-on.
+#
+# Main documentation:
+#
+# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md
+# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md
+{
+ # Define variables to be used throughout the configuration for all targets:
+ 'variables': {
+ # Source directory:
+ 'src_dir': './src',
+
+ # Include directories:
+ 'include_dirs': [
+ '
+
+/*
+* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler.
+*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+* Declare an opaque type definition for the PRNG state.
+*/
+typedef struct {
+ uint32_t *seed;
+ int64_t seed_length;
+ uint64_t state;
+ uint64_t increment;
+} stdlib_base_random_pcg32_state_t;
+
+/**
+* Returns a pointer to a dynamically allocated PRNG.
+*/
+struct BasePRNGObject * stdlib_base_random_pcg32_allocate( const uint32_t *seed, const int64_t len );
+
+/**
+* Frees a PRNG's allocated memory.
+*/
+void stdlib_base_random_pcg32_free( struct BasePRNGObject *obj );
+
+/**
+* Returns the PRNG seed length.
+*/
+int8_t stdlib_base_random_pcg32_seed_length( const struct BasePRNGObject *obj, int64_t *len );
+
+/**
+* Returns a PRNG seed.
+*/
+int8_t stdlib_base_random_pcg32_seed( const struct BasePRNGObject *obj, uint32_t *seed );
+
+/**
+* Returns a copy of the current PRNG state.
+*/
+void * stdlib_base_random_pcg32_state( const struct BasePRNGObject *obj );
+
+/**
+* Sets the PRNG state.
+*/
+int8_t stdlib_base_random_pcg32_set( struct BasePRNGObject *obj, const void *state );
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // !STDLIB_RANDOM_BASE_PCG32_H
diff --git a/lib/node_modules/@stdlib/random/base/pcg32/lib/factory.js b/lib/node_modules/@stdlib/random/base/pcg32/lib/factory.js
new file mode 100644
index 000000000000..575c0826171b
--- /dev/null
+++ b/lib/node_modules/@stdlib/random/base/pcg32/lib/factory.js
@@ -0,0 +1,476 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2026 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+/* eslint-disable max-len */
+
+'use strict';
+
+// MODULES //
+
+var typedarray2json = require( '@stdlib/array/to-json' );
+var Uint32Array = require( '@stdlib/array/uint32' );
+var hasOwnProp = require( '@stdlib/assert/has-own-property' );
+var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
+var isCollection = require( '@stdlib/assert/is-collection' );
+var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;
+var isObject = require( '@stdlib/assert/is-plain-object' );
+var isUint32Array = require( '@stdlib/assert/is-uint32array' );
+var gcopy = require( '@stdlib/blas/base/gcopy' );
+var UINT32_MAX = require( '@stdlib/constants/uint32/max' );
+var rotr = require( '@stdlib/number/uint32/base/rotr' );
+var add = require( '@stdlib/number/uint64/base/add' );
+var mul = require( '@stdlib/number/uint64/base/mul' );
+var rightShift = require( '@stdlib/number/uint64/base/right-shift' );
+var xor = require( '@stdlib/number/uint64/base/xor' );
+var format = require( '@stdlib/string/format' );
+var setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );
+var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
+var setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );
+var randuint32 = require( './rand_uint32.js' );
+
+
+// VARIABLES //
+
+// Define the LCG multiplier: 6364136223846793005 (Ref: https://github.com/imneme/pcg-c/blob/83252d9c23df9c82ecb42210afed61a7b42402d7/include/pcg_variants.h#L279)
+var MULTIPLIER = [ 0x5851f42d >>> 0, 0x4c957f2d >>> 0 ]; // asm type annotation
+
+// Define the default LCG increment: 1442695040888963407 (Ref: https://github.com/imneme/pcg-c/blob/83252d9c23df9c82ecb42210afed61a7b42402d7/include/pcg_variants.h#L284)
+var DEFAULT_INCREMENT = [ 0x14057b7e >>> 0, 0xf767814f >>> 0 ]; // asm type annotation
+
+// Define the size of the state section as a multiple of 32-bits:
+var N = 2;
+
+// Define the size of the increment section as a multiple of 32-bits:
+var M = 2; // NOTE: can we reuse N here or different variable is better? pcg always has same width state and increment
+
+// Define the maximum seed: 2^32-1 => 4294967295
+var MAX_SEED = UINT32_MAX >>> 0; // asm type annotation
+
+// Define a normalization constant when generating single-precision floating-point numbers: 1 / 2^32 => 1 / 4294967296
+var NORMALIZATION_CONSTANT = 1.0 / ( UINT32_MAX+1.0 );
+
+// Define the maximum normalized pseudorandom single-precision floating-point number: (2^32-1) / 2^32
+var MAX_NORMALIZED = UINT32_MAX * NORMALIZATION_CONSTANT;
+
+// Define the state array schema version:
+var STATE_ARRAY_VERSION = 1; // NOTE: anytime the state array schema changes, this value should be incremented!!!
+
+// Define the number of sections in the state array:
+var NUM_STATE_SECTIONS = 3; // state, increment, seed
+
+// Define the index offset of the "state" section in the state array:
+var STATE_SECTION_OFFSET = 2; // | version | num_sections | state_length | ...state | increment_length | ...increment | seed_length | ...seed |
+
+// Define the index offset of the "increment" section in the state array:
+var INCREMENT_SECTION_OFFSET = 3 + N; // | version | num_sections | state_length | ...state | increment_length | ...increment | seed_length | ...seed |
+
+// Define the index offset of the seed section in the state array:
+var SEED_SECTION_OFFSET = 4 + N + M; // | version | num_sections | state_length | ...state | increment_length | ...increment | seed_length | ...seed |
+
+// Define the length of the "fixed" length portion of the state array:
+var STATE_FIXED_LENGTH = 5 + N + M; // 1 (version) + 1 (num_sections) + 1 (state_length) + N (state) + 1 (increment_length) + M (increment) + 1 (seed_length)
+
+
+// FUNCTIONS //
+
+/**
+* Verifies state array integrity.
+*
+* @private
+* @param {Uint32Array} state - state array
+* @param {boolean} FLG - flag indicating whether the state array was provided as an option (true) or an argument (false)
+* @returns {(Error|null)} an error or `null`
+*/
+function verifyState( state, FLG ) {
+ var s1;
+ if ( FLG ) {
+ s1 = 'option';
+ } else {
+ s1 = 'argument';
+ }
+ // The state array must have a minimum length...
+ if ( state.length < STATE_FIXED_LENGTH+1 ) {
+ return new RangeError( format( 'invalid %s. State array has insufficient length.', s1 ) );
+ }
+ // The first element of the state array must equal the supported state array schema version...
+ if ( state[ 0 ] !== STATE_ARRAY_VERSION ) {
+ return new RangeError( format( 'invalid %s. State array has an incompatible schema version. Expected: `%s`. Actual: `%s`.', s1, STATE_ARRAY_VERSION, state[ 0 ] ) );
+ }
+ // The second element of the state array must contain the number of sections...
+ if ( state[ 1 ] !== NUM_STATE_SECTIONS ) {
+ return new RangeError( format( 'invalid %s. State array has an incompatible number of sections. Expected: `%s`. Actual: `%s`.', s1, NUM_STATE_SECTIONS, state[ 1 ] ) );
+ }
+ // The length of the "state" section must equal `N`...
+ if ( state[ STATE_SECTION_OFFSET ] !== N ) {
+ return new RangeError( format( 'invalid %s. State array has an incompatible state length. Expected: `%u`. Actual: `%u`.', s1, N, state[ STATE_SECTION_OFFSET ] ) );
+ }
+ // The length of the "increment" section must equal `M`...
+ if ( state[ INCREMENT_SECTION_OFFSET ] !== M ) {
+ return new RangeError( format( 'invalid %s. State array has an incompatible increment length. Expected: `%u`. Actual: `%u`.', s1, M, state[ INCREMENT_SECTION_OFFSET ] ) );
+ }
+ // The length of the "seed" section must match the empirical length...
+ if ( state[ SEED_SECTION_OFFSET ] !== state.length-STATE_FIXED_LENGTH ) {
+ return new RangeError( format( 'invalid %s. State array length is incompatible with seed section length. Expected: `%u`. Actual: `%u`.', s1, state.length-STATE_FIXED_LENGTH, state[ SEED_SECTION_OFFSET ] ) );
+ }
+ return null;
+}
+
+
+// MAIN //
+
+/**
+* Returns a 32-bit PCG pseudorandom number generator.
+*
+* @param {Options} [options] - options
+* @param {PRNGSeedPCG32} [options.seed] - pseudorandom number generator seed
+* @param {PRNGStatePCG32} [options.state] - pseudorandom number generator state
+* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state
+* @throws {TypeError} options argument must be an object
+* @throws {TypeError} a seed must be either a nonnegative integer less than or equal to the maximum 32-bit unsigned integer or an array-like object containing integers less than or equal to the maximum 32-bit unsigned integer
+* @throws {RangeError} a numeric seed must be a nonnegative integer less than or equal to the maximum 32-bit unsigned integer
+* @throws {TypeError} state must be a `Uint32Array`
+* @throws {Error} must provide a valid state
+* @throws {TypeError} `copy` option must be a boolean
+* @returns {PRNG} PCG PRNG
+*
+* @example
+* var pcg32 = factory();
+*
+* var v = pcg32();
+* // returns
+*
+* @example
+* // Return a seeded PCG PRNG:
+* var pcg32 = factory({
+* 'seed': 1234
+* });
+*
+* var v = pcg32();
+* // returns 2653504168
+*/
+function factory( options ) {
+ var XORSHIFTED;
+ var increment;
+ var OLDSTATE;
+ var STATE;
+ var state;
+ var opts;
+ var seed;
+ var slen;
+ var err;
+
+ // NOTE: can we merge these into the state array as OTHER SECTION or use a WORKSPACE-like array?
+ XORSHIFTED = new Uint32Array( 2 );
+ OLDSTATE = new Uint32Array( 2 );
+
+ opts = {};
+ if ( arguments.length ) {
+ if ( !isObject( options ) ) {
+ throw new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );
+ }
+ if ( hasOwnProp( options, 'copy' ) ) {
+ opts.copy = options.copy;
+ if ( !isBoolean( options.copy ) ) {
+ throw new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', options.copy ) );
+ }
+ }
+ if ( hasOwnProp( options, 'state' ) ) {
+ state = options.state;
+ opts.state = true;
+ if ( !isUint32Array( state ) ) {
+ throw new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', state ) );
+ }
+ err = verifyState( state, true );
+ if ( err ) {
+ throw err;
+ }
+ if ( opts.copy === false ) {
+ STATE = state;
+ } else {
+ STATE = new Uint32Array( state.length );
+ gcopy( state.length, state, 1, STATE, 1 );
+ }
+ } else if ( hasOwnProp( options, 'seed' ) ) {
+ // If provided a PRNG state, we ignore the `seed` option...
+ seed = options.seed;
+ opts.seed = true;
+ if ( isNonNegativeInteger( seed ) ) {
+ if ( seed > MAX_SEED ) {
+ throw new RangeError( format( 'invalid option. `%s` option must be a nonnegative integer less than or equal to the maximum 32-bit unsigned integer. Option: `%u`.', 'seed', seed ) );
+ }
+ // Wrap inside an array for uniform processing:
+ seed = [ seed ];
+ } else if ( !isCollection( seed ) || seed.length < 1 ) {
+ throw new TypeError( format( 'invalid option. `%s` option must be either a nonnegative integer less than or equal to the maximum 32-bit unsigned integer or an array-like object containing nonnegative integer values less than or equal to the maximum 32-bit unsigned integer. Option: `%s`.', 'seed', seed ) );
+ }
+ // TODO: should we also support Uint64 and Uint64Array?
+ }
+ }
+
+ // Create the state array if not provided a PRNG state:
+ if ( !opts.state ) {
+ if ( !opts.seed ) {
+ // Generate a random seed if the `seed` option or the `options` argument is not provided:
+ seed = [ randuint32() ];
+ }
+ slen = seed.length;
+ STATE = new Uint32Array( STATE_FIXED_LENGTH+slen );
+
+ // Initialize sections:
+ STATE[ 0 ] = STATE_ARRAY_VERSION;
+ STATE[ 1 ] = NUM_STATE_SECTIONS;
+ STATE[ STATE_SECTION_OFFSET ] = N;
+ STATE[ INCREMENT_SECTION_OFFSET ] = M;
+ STATE[ SEED_SECTION_OFFSET ] = slen;
+
+ gcopy.ndarray( slen, seed, 1, 0, STATE, 1, SEED_SECTION_OFFSET+1 );
+ }
+
+ // Create a state "view":
+ state = new Uint32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), N );
+
+ // Create an increment "view":
+ increment = new Uint32Array( STATE.buffer, STATE.byteOffset+((INCREMENT_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), M );
+
+ // Create a seed "view":
+ seed = new Uint32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), STATE[ SEED_SECTION_OFFSET ] );
+
+ // Initialize the internal PRNG state:
+ if ( !opts.state ) {
+ // Initialize the LCG increment:
+ if ( slen < 3 ) {
+ increment[ 0 ] = DEFAULT_INCREMENT[ 0 ];
+ increment[ 1 ] = DEFAULT_INCREMENT[ 1 ];
+ } else {
+ if ( slen > 3 ) {
+ increment[ 0 ] = seed[ 2 ];
+ increment[ 1 ] = seed[ 3 ];
+ } else {
+ increment[ 0 ] = 0;
+ increment[ 1 ] = seed[ 2 ];
+ }
+ // Ensure the increment is an odd number:
+ // leftShift.strided( increment, 1, 0, 1, increment, 1, 0 );
+ // or.assign( increment[ 0 ], increment[ 1 ], 0, 1, increment, 1, 0 );
+ increment[ 0 ] = ( increment[ 0 ] << 1 ) | ( increment[ 1 ] >>> 31 );
+ increment[ 1 ] = ( increment[ 1 ] << 1 ) | 1;
+ }
+
+ // Run PCG warm-up sequence:
+ pcg32();
+ if ( slen > 1 ) { // Use the first two elements of the seed array as the high and low 32-bit word of a 64-bit unsigned integer if the seed array length is greater than 1
+ add.assign( state[ 0 ], state[ 1 ], seed[ 0 ], seed[ 1 ], state, 1, 0 );
+ } else { // Otherwise use the only element as the low 32-bit word
+ add.assign( state[ 0 ], state[ 1 ], 0, seed[ 0 ], state, 1, 0 );
+ }
+ pcg32();
+ }
+
+ // Note: property order matters in order to maintain consistency of PRNG "shape" (hidden classes).
+ setReadOnly( pcg32, 'NAME', 'pcg32' );
+ setReadOnlyAccessor( pcg32, 'seed', getSeed );
+ setReadOnlyAccessor( pcg32, 'seedLength', getSeedLength );
+ setReadWriteAccessor( pcg32, 'state', getState, setState );
+ setReadOnlyAccessor( pcg32, 'stateLength', getStateLength );
+ setReadOnlyAccessor( pcg32, 'byteLength', getStateSize );
+ setReadOnly( pcg32, 'toJSON', toJSON );
+ setReadOnly( pcg32, 'MIN', 0 );
+ setReadOnly( pcg32, 'MAX', UINT32_MAX );
+ setReadOnly( pcg32, 'normalized', normalized );
+
+ setReadOnly( normalized, 'NAME', pcg32.NAME );
+ setReadOnlyAccessor( normalized, 'seed', getSeed );
+ setReadOnlyAccessor( normalized, 'seedLength', getSeedLength );
+ setReadWriteAccessor( normalized, 'state', getState, setState );
+ setReadOnlyAccessor( normalized, 'stateLength', getStateLength );
+ setReadOnlyAccessor( normalized, 'byteLength', getStateSize );
+ setReadOnly( normalized, 'toJSON', toJSON );
+ setReadOnly( normalized, 'MIN', 0.0 );
+ setReadOnly( normalized, 'MAX', MAX_NORMALIZED );
+
+ return pcg32;
+
+ /**
+ * Returns the PRNG seed.
+ *
+ * @private
+ * @returns {PRNGSeedPCG32} seed
+ */
+ function getSeed() {
+ var len = STATE[ SEED_SECTION_OFFSET ];
+ return gcopy( len, seed, 1, new Uint32Array( len ), 1 );
+ }
+
+ /**
+ * Returns the PRNG seed length.
+ *
+ * @private
+ * @returns {PositiveInteger} seed length
+ */
+ function getSeedLength() {
+ return STATE[ SEED_SECTION_OFFSET ];
+ }
+
+ /**
+ * Returns the PRNG state length.
+ *
+ * @private
+ * @returns {PositiveInteger} state length
+ */
+ function getStateLength() {
+ return STATE.length;
+ }
+
+ /**
+ * Returns the PRNG state size (in bytes).
+ *
+ * @private
+ * @returns {PositiveInteger} state size (in bytes)
+ */
+ function getStateSize() {
+ return STATE.byteLength;
+ }
+
+ /**
+ * Returns the current PRNG state.
+ *
+ * ## Notes
+ *
+ * - The PRNG state array is comprised of a preamble followed by `3` sections:
+ *
+ * 0. preamble (version + number of sections)
+ * 1. internal PRNG state
+ * 2. internal LCG increment
+ * 3. PRNG seed
+ *
+ * - The first element of the PRNG state array preamble is the state array schema version.
+ *
+ * - The second element of the PRNG state array preamble is the number of state array sections (i.e., `3`).
+ *
+ * - The first element of each section following the preamble specifies the section length. The remaining section elements comprise the section contents.
+ *
+ * @private
+ * @returns {PRNGStatePCG32} current state
+ */
+ function getState() {
+ var len = STATE.length;
+ return gcopy( len, STATE, 1, new Uint32Array( len ), 1 );
+ }
+
+ /**
+ * Sets the PRNG state.
+ *
+ * ## Notes
+ *
+ * - If PRNG state is "shared" (meaning a state array was provided during PRNG creation and **not** copied) and one sets the generator state to a state array having a different length, the PRNG does **not** update the existing shared state and, instead, points to the newly provided state array. In order to synchronize PRNG output according to the new shared state array, the state array for **each** relevant PRNG must be **explicitly** set.
+ * - If PRNG state is "shared" and one sets the generator state to a state array of the same length, the PRNG state is updated (along with the state of all other PRNGs sharing the PRNG's state array).
+ *
+ * @private
+ * @param {PRNGStatePCG32} s - generator state
+ * @throws {TypeError} must provide a `Uint32Array`
+ * @throws {Error} must provide a valid state
+ */
+ function setState( s ) {
+ var err;
+ if ( !isUint32Array( s ) ) {
+ throw new TypeError( format( 'invalid argument. Must provide a Uint32Array. Value: `%s`.', s ) );
+ }
+ err = verifyState( s, false );
+ if ( err ) {
+ throw err;
+ }
+ if ( opts.copy === false ) {
+ if ( opts.state && s.length === STATE.length ) {
+ gcopy( s.length, s, 1, STATE, 1 ); // update current shared state
+ } else {
+ STATE = s; // point to new shared state
+ opts.state = true; // setting this flag allows updating a shared state even if a state array was not provided at PRNG creation
+ }
+ } else {
+ // Check if we can reuse allocated memory...
+ if ( s.length !== STATE.length ) {
+ STATE = new Uint32Array( s.length ); // reallocate
+ }
+ gcopy( s.length, s, 1, STATE, 1 );
+ }
+ // Create a new state "view":
+ state = new Uint32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), N );
+
+ // Create a new seed "view":
+ seed = new Uint32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), STATE[ SEED_SECTION_OFFSET ] );
+ }
+
+ /**
+ * Serializes the pseudorandom number generator as a JSON object.
+ *
+ * ## Notes
+ *
+ * - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.
+ *
+ * @private
+ * @returns {Object} JSON representation
+ */
+ function toJSON() {
+ var out = {};
+ out.type = 'PRNG';
+ out.name = pcg32.NAME;
+ out.state = typedarray2json( STATE );
+ out.params = [];
+ return out;
+ }
+
+ /**
+ * Generates a pseudorandom integer on the interval \\( [0, 2^{32}) \\).
+ *
+ * @private
+ * @returns {uinteger32} pseudorandom integer
+ */
+ function pcg32() {
+ var rot;
+ var out;
+
+ // Update the PRNG state:
+ gcopy( 2, state, 1, OLDSTATE, 1 );
+ mul.strided( state, 1, 0, MULTIPLIER, 1, 0, state, 1, 0 );
+ add.strided( state, 1, 0, increment, 1, 0, state, 1, 0 );
+
+ // Apply output permutaion (XSH-RR)
+ rightShift.strided( OLDSTATE, 1, 0, 18, XORSHIFTED, 1, 0 );
+ xor.strided( XORSHIFTED, 1, 0, OLDSTATE, 1, 0, XORSHIFTED, 1, 0 );
+ rightShift.strided( XORSHIFTED, 1, 0, 27, XORSHIFTED, 1, 0 );
+ XORSHIFTED[ 0 ] = 0; // truncate to 32-bit
+ rot = OLDSTATE[ 0 ] >>> 27; // extract rotate bits
+ out = rotr( XORSHIFTED[ 1 ], rot );
+ return out;
+ }
+
+ /**
+ * Generates a pseudorandom number on the interval \\( [0, 1) \\).
+ *
+ * @private
+ * @returns {number} pseudorandom number
+ */
+ function normalized() {
+ return pcg32() * NORMALIZATION_CONSTANT;
+ }
+}
+
+
+// EXPORTS //
+
+module.exports = factory;
diff --git a/lib/node_modules/@stdlib/random/base/pcg32/lib/factory0.js b/lib/node_modules/@stdlib/random/base/pcg32/lib/factory0.js
new file mode 100644
index 000000000000..6be34e90d3b3
--- /dev/null
+++ b/lib/node_modules/@stdlib/random/base/pcg32/lib/factory0.js
@@ -0,0 +1,509 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2026 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+/* eslint-disable max-len, max-statements */
+
+'use strict';
+
+// MODULES //
+
+var typedarray2json = require( '@stdlib/array/to-json' );
+var Uint32Array = require( '@stdlib/array/uint32' );
+var hasOwnProp = require( '@stdlib/assert/has-own-property' );
+var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
+var isCollection = require( '@stdlib/assert/is-collection' );
+var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;
+var isObject = require( '@stdlib/assert/is-plain-object' );
+var isUint32Array = require( '@stdlib/assert/is-uint32array' );
+var gcopy = require( '@stdlib/blas/base/gcopy' );
+var UINT32_MAX = require( '@stdlib/constants/uint32/max' );
+var rotr = require( '@stdlib/number/uint32/base/rotr' );
+var add = require( '@stdlib/number/uint64/base/add' );
+var mul = require( '@stdlib/number/uint64/base/mul' );
+var rightShift = require( '@stdlib/number/uint64/base/right-shift' );
+var xor = require( '@stdlib/number/uint64/base/xor' );
+var format = require( '@stdlib/string/format' );
+var setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );
+var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
+var setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );
+var randuint32 = require( './rand_uint32.js' );
+
+
+// VARIABLES //
+
+// Define the LCG multiplier: 6364136223846793005 (Ref: https://github.com/imneme/pcg-c/blob/83252d9c23df9c82ecb42210afed61a7b42402d7/include/pcg_variants.h#L279)
+var MULTIPLIER = [ 0x5851f42d >>> 0, 0x4c957f2d >>> 0 ]; // asm type annotation
+
+// Define the default LCG increment: 1442695040888963407 (Ref: https://github.com/imneme/pcg-c/blob/83252d9c23df9c82ecb42210afed61a7b42402d7/include/pcg_variants.h#L284)
+var DEFAULT_INCREMENT = [ 0x14057b7e >>> 0, 0xf767814f >>> 0 ]; // asm type annotation
+
+// Define the size of the state section as a multiple of 32-bits:
+var N = 2;
+
+// Define the size of the increment section as a multiple of 32-bits:
+var M = 2; // NOTE: can we reuse N here or different variable is better? pcg always has same width state and increment
+
+// Define the maximum seed: 2^32-1 => 4294967295
+var MAX_SEED = UINT32_MAX >>> 0; // asm type annotation
+
+// Define a normalization constant when generating single-precision floating-point numbers: 1 / 2^32 => 1 / 4294967296
+var NORMALIZATION_CONSTANT = 1.0 / ( UINT32_MAX+1.0 );
+
+// Define the maximum normalized pseudorandom single-precision floating-point number: (2^32-1) / 2^32
+var MAX_NORMALIZED = UINT32_MAX * NORMALIZATION_CONSTANT;
+
+// Define the state array schema version:
+var STATE_ARRAY_VERSION = 1; // NOTE: anytime the state array schema changes, this value should be incremented!!!
+
+// Define the number of sections in the state array:
+var NUM_STATE_SECTIONS = 3; // state, increment, seed
+
+// Define the index offset of the "state" section in the state array:
+var STATE_SECTION_OFFSET = 2; // | version | num_sections | state_length | ...state | increment_length | ...increment | seed_length | ...seed |
+
+// Define the index offset of the "increment" section in the state array:
+var INCREMENT_SECTION_OFFSET = 3 + N; // | version | num_sections | state_length | ...state | increment_length | ...increment | seed_length | ...seed |
+
+// Define the index offset of the seed section in the state array:
+var SEED_SECTION_OFFSET = 4 + N + M; // | version | num_sections | state_length | ...state | increment_length | ...increment | seed_length | ...seed |
+
+// Define the length of the "fixed" length portion of the state array:
+var STATE_FIXED_LENGTH = 5 + N + M; // 1 (version) + 1 (num_sections) + 1 (state_length) + N (state) + 1 (increment_length) + M (increment) + 1 (seed_length)
+
+
+// FUNCTIONS //
+
+/**
+* Verifies state array integrity.
+*
+* @private
+* @param {Uint32Array} state - state array
+* @param {boolean} FLG - flag indicating whether the state array was provided as an option (true) or an argument (false)
+* @returns {(Error|null)} an error or `null`
+*/
+function verifyState( state, FLG ) {
+ var s1;
+ if ( FLG ) {
+ s1 = 'option';
+ } else {
+ s1 = 'argument';
+ }
+ // The state array must have a minimum length...
+ if ( state.length < STATE_FIXED_LENGTH+1 ) {
+ return new RangeError( format( 'invalid %s. State array has insufficient length.', s1 ) );
+ }
+ // The first element of the state array must equal the supported state array schema version...
+ if ( state[ 0 ] !== STATE_ARRAY_VERSION ) {
+ return new RangeError( format( 'invalid %s. State array has an incompatible schema version. Expected: `%s`. Actual: `%s`.', s1, STATE_ARRAY_VERSION, state[ 0 ] ) );
+ }
+ // The second element of the state array must contain the number of sections...
+ if ( state[ 1 ] !== NUM_STATE_SECTIONS ) {
+ return new RangeError( format( 'invalid %s. State array has an incompatible number of sections. Expected: `%s`. Actual: `%s`.', s1, NUM_STATE_SECTIONS, state[ 1 ] ) );
+ }
+ // The length of the "state" section must equal `N`...
+ if ( state[ STATE_SECTION_OFFSET ] !== N ) {
+ return new RangeError( format( 'invalid %s. State array has an incompatible state length. Expected: `%u`. Actual: `%u`.', s1, N, state[ STATE_SECTION_OFFSET ] ) );
+ }
+ // The length of the "increment" section must equal `M`...
+ if ( state[ INCREMENT_SECTION_OFFSET ] !== M ) {
+ return new RangeError( format( 'invalid %s. State array has an incompatible increment length. Expected: `%u`. Actual: `%u`.', s1, M, state[ INCREMENT_SECTION_OFFSET ] ) );
+ }
+ // The length of the "seed" section must match the empirical length...
+ if ( state[ SEED_SECTION_OFFSET ] !== state.length-STATE_FIXED_LENGTH ) {
+ return new RangeError( format( 'invalid %s. State array length is incompatible with seed section length. Expected: `%u`. Actual: `%u`.', s1, state.length-STATE_FIXED_LENGTH, state[ SEED_SECTION_OFFSET ] ) );
+ }
+ return null;
+}
+
+
+// MAIN //
+
+/**
+* Returns a 32-bit PCG pseudorandom number generator.
+*
+* @param {Options} [options] - options
+* @param {PRNGSeedPCG32} [options.seed] - pseudorandom number generator seed
+* @param {PRNGStatePCG32} [options.state] - pseudorandom number generator state
+* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state
+* @throws {TypeError} options argument must be an object
+* @throws {TypeError} a seed must be either a nonnegative integer less than or equal to the maximum 32-bit unsigned integer or an array-like object containing integers less than or equal to the maximum 32-bit unsigned integer
+* @throws {RangeError} a numeric seed must be a nonnegative integer less than or equal to the maximum 32-bit unsigned integer
+* @throws {TypeError} state must be a `Uint32Array`
+* @throws {Error} must provide a valid state
+* @throws {TypeError} `copy` option must be a boolean
+* @returns {PRNG} PCG PRNG
+*
+* @example
+* var pcg32 = factory();
+*
+* var v = pcg32();
+* // returns
+*
+* @example
+* // Return a seeded PCG PRNG:
+* var pcg32 = factory({
+* 'seed': 1234
+* });
+*
+* var v = pcg32();
+* // returns 2653504168
+*/
+function factory( options ) {
+ var XORSHIFTED;
+ var increment;
+ var OLDSTATE;
+ var STATE;
+ var state;
+ var opts;
+ var seed;
+ var slen;
+ var err;
+
+ // NOTE: can we merge these into the state array as OTHER SECTION or use a WORKSPACE-like array?
+ XORSHIFTED = new Uint32Array( 2 );
+ OLDSTATE = new Uint32Array( 2 );
+
+ opts = {};
+ if ( arguments.length ) {
+ if ( !isObject( options ) ) {
+ throw new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );
+ }
+ if ( hasOwnProp( options, 'copy' ) ) {
+ opts.copy = options.copy;
+ if ( !isBoolean( options.copy ) ) {
+ throw new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', options.copy ) );
+ }
+ }
+ if ( hasOwnProp( options, 'state' ) ) {
+ state = options.state;
+ opts.state = true;
+ if ( !isUint32Array( state ) ) {
+ throw new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', state ) );
+ }
+ err = verifyState( state, true );
+ if ( err ) {
+ throw err;
+ }
+ if ( opts.copy === false ) {
+ STATE = state;
+ } else {
+ STATE = new Uint32Array( state.length );
+ gcopy( state.length, state, 1, STATE, 1 );
+ }
+ // Create a state "view":
+ state = new Uint32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), N );
+
+ // Create an increment "view":
+ increment = new Uint32Array( STATE.buffer, STATE.byteOffset+((INCREMENT_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), M );
+
+ // Create a seed "view":
+ seed = new Uint32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), state[ SEED_SECTION_OFFSET ] );
+ }
+ // If provided a PRNG state, we ignore the `seed` option...
+ if ( seed === void 0 ) {
+ if ( hasOwnProp( options, 'seed' ) ) {
+ seed = options.seed;
+ opts.seed = true;
+ if ( isNonNegativeInteger( seed ) ) {
+ if ( seed > MAX_SEED ) {
+ throw new RangeError( format( 'invalid option. `%s` option must be a nonnegative integer less than or equal to the maximum 32-bit unsigned integer. Option: `%u`.', 'seed', seed ) );
+ }
+ seed >>>= 0; // asm type annotation
+ } else if ( isCollection( seed ) && seed.length > 0 ) {
+ slen = seed.length;
+ STATE = new Uint32Array( STATE_FIXED_LENGTH+slen );
+
+ // Initialize sections:
+ STATE[ 0 ] = STATE_ARRAY_VERSION;
+ STATE[ 1 ] = NUM_STATE_SECTIONS;
+ STATE[ STATE_SECTION_OFFSET ] = N;
+ STATE[ INCREMENT_SECTION_OFFSET ] = M;
+ STATE[ SEED_SECTION_OFFSET ] = slen;
+
+ // Copy the provided seed array to prevent external mutation, as mutation would lead to an inability to reproduce PRNG values according to the PRNG's stated seed:
+ gcopy.ndarray( slen, seed, 1, 0, STATE, 1, SEED_SECTION_OFFSET+1 );
+
+ // Create a state "view":
+ state = new Uint32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), N );
+
+ // Create an increment "view":
+ increment = new Uint32Array( STATE.buffer, STATE.byteOffset+((INCREMENT_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), M );
+
+ // Create a seed "view":
+ seed = new Uint32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), slen );
+
+ // Initialize the LCG increment:
+ if ( slen < 3 ) {
+ increment[ 0 ] = DEFAULT_INCREMENT[ 0 ];
+ increment[ 1 ] = DEFAULT_INCREMENT[ 1 ];
+ } else {
+ if ( slen > 3 ) { // eslint-disable-line max-depth
+ increment[ 0 ] = seed[ 2 ];
+ increment[ 1 ] = seed[ 3 ];
+ } else {
+ increment[ 0 ] = 0;
+ increment[ 1 ] = seed[ 2 ];
+ }
+ // Ensure the increment is an odd number:
+ // leftShift.strided( increment, 1, 0, 1, increment, 1, 0 );
+ // or.assign( increment[ 0 ], increment[ 1 ], 0, 1, increment, 1, 0 );
+ increment[ 0 ] = ( increment[ 0 ] << 1 ) | ( increment[ 1 ] >>> 31 );
+ increment[ 1 ] = ( increment[ 1 ] << 1 ) | 1;
+ }
+
+ // Run PCG warm-up sequence:
+ pcg32();
+ if ( slen > 1 ) { // Use the first two elements of the seed array as the high and low 32-bit word of a 64-bit unsigned integer if the seed array length is greater than 1
+ add.assign( state[ 0 ], state[ 1 ], seed[ 0 ], seed[ 1 ], state, 1, 0 );
+ } else { // Otherwise use the only element as the low 32-bit word
+ add.assign( state[ 0 ], state[ 1 ], 0, seed[ 0 ], state, 1, 0 );
+ }
+ pcg32();
+ } else {
+ throw new TypeError( format( 'invalid option. `%s` option must be either a nonnegative integer less than or equal to the maximum 32-bit unsigned integer or an array-like object containing nonnegative integer values less than or equal to the maximum 32-bit unsigned integer. Option: `%s`.', 'seed', seed ) );
+ }
+ } else {
+ seed = randuint32() >>> 0; // asm type annotation
+ }
+ }
+ } else {
+ seed = randuint32() >>> 0; // asm type annotation
+ }
+ if ( state === void 0 ) {
+ STATE = new Uint32Array( STATE_FIXED_LENGTH+1 );
+
+ // Initialize sections:
+ STATE[ 0 ] = STATE_ARRAY_VERSION;
+ STATE[ 1 ] = NUM_STATE_SECTIONS;
+ STATE[ STATE_SECTION_OFFSET ] = N;
+ STATE[ INCREMENT_SECTION_OFFSET ] = M;
+ STATE[ SEED_SECTION_OFFSET ] = 1;
+ STATE[ SEED_SECTION_OFFSET+1 ] = seed;
+
+ // Create a state "view":
+ state = new Uint32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), N );
+
+ // Create an increment "view":
+ increment = new Uint32Array( STATE.buffer, STATE.byteOffset+((INCREMENT_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), M );
+
+ // Create a seed "view":
+ seed = new Uint32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), 1 );
+
+ // Initialize the LCG increment:
+ increment[ 0 ] = DEFAULT_INCREMENT[ 0 ];
+ increment[ 1 ] = DEFAULT_INCREMENT[ 1 ];
+
+ // Initialize the internal PRNG state:
+ pcg32();
+ add.assign( state[ 0 ], state[ 1 ], 0, seed[ 0 ], state, 1, 0 );
+ pcg32();
+ }
+
+ // Note: property order matters in order to maintain consistency of PRNG "shape" (hidden classes).
+ setReadOnly( pcg32, 'NAME', 'pcg32' );
+ setReadOnlyAccessor( pcg32, 'seed', getSeed );
+ setReadOnlyAccessor( pcg32, 'seedLength', getSeedLength );
+ setReadWriteAccessor( pcg32, 'state', getState, setState );
+ setReadOnlyAccessor( pcg32, 'stateLength', getStateLength );
+ setReadOnlyAccessor( pcg32, 'byteLength', getStateSize );
+ setReadOnly( pcg32, 'toJSON', toJSON );
+ setReadOnly( pcg32, 'MIN', 0 );
+ setReadOnly( pcg32, 'MAX', UINT32_MAX );
+ setReadOnly( pcg32, 'normalized', normalized );
+
+ setReadOnly( normalized, 'NAME', pcg32.NAME );
+ setReadOnlyAccessor( normalized, 'seed', getSeed );
+ setReadOnlyAccessor( normalized, 'seedLength', getSeedLength );
+ setReadWriteAccessor( normalized, 'state', getState, setState );
+ setReadOnlyAccessor( normalized, 'stateLength', getStateLength );
+ setReadOnlyAccessor( normalized, 'byteLength', getStateSize );
+ setReadOnly( normalized, 'toJSON', toJSON );
+ setReadOnly( normalized, 'MIN', 0.0 );
+ setReadOnly( normalized, 'MAX', MAX_NORMALIZED );
+
+ return pcg32;
+
+ /**
+ * Returns the PRNG seed.
+ *
+ * @private
+ * @returns {PRNGSeedPCG32} seed
+ */
+ function getSeed() {
+ var len = STATE[ SEED_SECTION_OFFSET ];
+ return gcopy( len, seed, 1, new Uint32Array( len ), 1 );
+ }
+
+ /**
+ * Returns the PRNG seed length.
+ *
+ * @private
+ * @returns {PositiveInteger} seed length
+ */
+ function getSeedLength() {
+ return STATE[ SEED_SECTION_OFFSET ];
+ }
+
+ /**
+ * Returns the PRNG state length.
+ *
+ * @private
+ * @returns {PositiveInteger} state length
+ */
+ function getStateLength() {
+ return STATE.length;
+ }
+
+ /**
+ * Returns the PRNG state size (in bytes).
+ *
+ * @private
+ * @returns {PositiveInteger} state size (in bytes)
+ */
+ function getStateSize() {
+ return STATE.byteLength;
+ }
+
+ /**
+ * Returns the current PRNG state.
+ *
+ * ## Notes
+ *
+ * - The PRNG state array is comprised of a preamble followed by `3` sections:
+ *
+ * 0. preamble (version + number of sections)
+ * 1. internal PRNG state
+ * 2. internal LCG increment
+ * 3. PRNG seed
+ *
+ * - The first element of the PRNG state array preamble is the state array schema version.
+ *
+ * - The second element of the PRNG state array preamble is the number of state array sections (i.e., `3`).
+ *
+ * - The first element of each section following the preamble specifies the section length. The remaining section elements comprise the section contents.
+ *
+ * @private
+ * @returns {PRNGStatePCG32} current state
+ */
+ function getState() {
+ var len = STATE.length;
+ return gcopy( len, STATE, 1, new Uint32Array( len ), 1 );
+ }
+
+ /**
+ * Sets the PRNG state.
+ *
+ * ## Notes
+ *
+ * - If PRNG state is "shared" (meaning a state array was provided during PRNG creation and **not** copied) and one sets the generator state to a state array having a different length, the PRNG does **not** update the existing shared state and, instead, points to the newly provided state array. In order to synchronize PRNG output according to the new shared state array, the state array for **each** relevant PRNG must be **explicitly** set.
+ * - If PRNG state is "shared" and one sets the generator state to a state array of the same length, the PRNG state is updated (along with the state of all other PRNGs sharing the PRNG's state array).
+ *
+ * @private
+ * @param {PRNGStatePCG32} s - generator state
+ * @throws {TypeError} must provide a `Uint32Array`
+ * @throws {Error} must provide a valid state
+ */
+ function setState( s ) {
+ var err;
+ if ( !isUint32Array( s ) ) {
+ throw new TypeError( format( 'invalid argument. Must provide a Uint32Array. Value: `%s`.', s ) );
+ }
+ err = verifyState( s, false );
+ if ( err ) {
+ throw err;
+ }
+ if ( opts.copy === false ) {
+ if ( opts.state && s.length === STATE.length ) {
+ gcopy( s.length, s, 1, STATE, 1 ); // update current shared state
+ } else {
+ STATE = s; // point to new shared state
+ opts.state = true; // setting this flag allows updating a shared state even if a state array was not provided at PRNG creation
+ }
+ } else {
+ // Check if we can reuse allocated memory...
+ if ( s.length !== STATE.length ) {
+ STATE = new Uint32Array( s.length ); // reallocate
+ }
+ gcopy( s.length, s, 1, STATE, 1 );
+ }
+ // Create a new state "view":
+ state = new Uint32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), N );
+
+ // Create a new seed "view":
+ seed = new Uint32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), STATE[ SEED_SECTION_OFFSET ] );
+ }
+
+ /**
+ * Serializes the pseudorandom number generator as a JSON object.
+ *
+ * ## Notes
+ *
+ * - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.
+ *
+ * @private
+ * @returns {Object} JSON representation
+ */
+ function toJSON() {
+ var out = {};
+ out.type = 'PRNG';
+ out.name = pcg32.NAME;
+ out.state = typedarray2json( STATE );
+ out.params = [];
+ return out;
+ }
+
+ /**
+ * Generates a pseudorandom integer on the interval \\( [0, 2^{32}) \\).
+ *
+ * @private
+ * @returns {uinteger32} pseudorandom integer
+ */
+ function pcg32() {
+ var rot;
+ var out;
+
+ // Update the PRNG state:
+ gcopy( 2, state, 1, OLDSTATE, 1 );
+ mul.strided( state, 1, 0, MULTIPLIER, 1, 0, state, 1, 0 );
+ add.strided( state, 1, 0, increment, 1, 0, state, 1, 0 );
+
+ // Apply output permutaion (XSH-RR)
+ rightShift.strided( OLDSTATE, 1, 0, 18, XORSHIFTED, 1, 0 );
+ xor.strided( XORSHIFTED, 1, 0, OLDSTATE, 1, 0, XORSHIFTED, 1, 0 );
+ rightShift.strided( XORSHIFTED, 1, 0, 27, XORSHIFTED, 1, 0 );
+ XORSHIFTED[ 0 ] = 0; // truncate to 32-bit
+ rot = OLDSTATE[ 0 ] >>> 27; // extract rotate bits
+ out = rotr( XORSHIFTED[ 1 ], rot );
+ return out;
+ }
+
+ /**
+ * Generates a pseudorandom number on the interval \\( [0, 1) \\).
+ *
+ * @private
+ * @returns {number} pseudorandom number
+ */
+ function normalized() {
+ return pcg32() * NORMALIZATION_CONSTANT;
+ }
+}
+
+
+// EXPORTS //
+
+module.exports = factory;
diff --git a/lib/node_modules/@stdlib/random/base/pcg32/lib/index.js b/lib/node_modules/@stdlib/random/base/pcg32/lib/index.js
new file mode 100644
index 000000000000..d444a96a634a
--- /dev/null
+++ b/lib/node_modules/@stdlib/random/base/pcg32/lib/index.js
@@ -0,0 +1,57 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2026 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+'use strict';
+
+/**
+* A 32-bit permuted congruential pseudorandom number generator (PCG) based on O’Neill.
+*
+* @module @stdlib/random/base/pcg32
+*
+* @example
+* var pcg32 = require( '@stdlib/random/base/pcg32' );
+*
+* var v = pcg32();
+* // returns
+*
+* @example
+* var factory = require( '@stdlib/random/base/pcg32' ).factory;
+*
+* var pcg32 = factory({
+* 'seed': 1234
+* });
+*
+* var v = pcg32();
+* // returns 2653504168
+*/
+
+// MODULES //
+
+var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
+var main = require( './main.js' );
+var factory = require( './factory.js' );
+
+
+// MAIN //
+
+setReadOnly( main, 'factory', factory );
+
+
+// EXPORTS //
+
+module.exports = main;
diff --git a/lib/node_modules/@stdlib/random/base/pcg32/lib/main.js b/lib/node_modules/@stdlib/random/base/pcg32/lib/main.js
new file mode 100644
index 000000000000..ba7f2a85ccf6
--- /dev/null
+++ b/lib/node_modules/@stdlib/random/base/pcg32/lib/main.js
@@ -0,0 +1,94 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2026 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+'use strict';
+
+// MODULES //
+
+var factory = require( './factory.js' );
+var randuint32 = require( './rand_uint32.js' );
+
+
+// MAIN //
+
+/**
+* Generates a pseudorandom integer on the interval \\( [0, 2^{32}) \\) using the PCG32 XSH-RR generator.
+*
+* ## Method
+*
+* PCG (Permuted Congruential Generator) combines a traditional linear congruential generator (LCG) with an output permutation to improve statistical quality.
+*
+* The internal state is advanced using the LCG recurrence:
+*
+* ```tex
+* X_{n+1} = a \cdot X_n + c \mod 2^{64}
+* ```
+*
+* where:
+*
+* ```tex
+* \begin{align*}
+* a &= 6364136223846793005 \\
+* c &= \text{user-defined increment (must be odd)}
+* \end{align*}
+* ```
+*
+* The output function applies a permutation (XSH-RR variant), which extracts and rotates bits to decorrelate output from internal state:
+*
+* ```tex
+* \text{output} = \operatorname{rotr}\left((x \gg ((x \gg 59) + 5)) \bmod 2^{32}, x \gg 27\right)
+* ```
+*
+*
+*
+* Unlike raw LCGs, PCG’s output permutation helps avoid patterns in the lower bits and produces statistically robust outputs.
+*
+*
+*
+*
+*
+* The internal LCG uses 64-bit arithmetic, but the output is a 32-bit integer.
+*
+*
+*
+* The constants and permutation functions are based on O’Neill's 2014 technical report, _"PCG: A Family of Simple Fast Space-Efficient Statistically Good Algorithms for Random Number Generation"_.
+*
+* ## Notes
+*
+* - The generator has a period of \\( 2^{64} \\).
+*
+* ## References
+*
+* - O’Neill, Melissa E. 2014. “PCG: A Family of Simple Fast Space-Efficient Statistically Good Algorithms for Random Number Generation.” Technical Report HMC-CS-2014-0905. Harvey Mudd College, Claremont, CA. [https://www.cs.hmc.edu/tr/hmc-cs-2014-0905.pdf](https://www.cs.hmc.edu/tr/hmc-cs-2014-0905.pdf).
+*
+* @function pcg32
+* @type {PRNG}
+* @returns {PositiveInteger} pseudorandom integer
+*
+* @example
+* var v = pcg32();
+* // returns
+*/
+var pcg32 = factory({
+ 'seed': randuint32()
+});
+
+
+// EXPORTS //
+
+module.exports = pcg32;
diff --git a/lib/node_modules/@stdlib/random/base/pcg32/lib/native.js b/lib/node_modules/@stdlib/random/base/pcg32/lib/native.js
new file mode 100644
index 000000000000..dbbb77c1d6c6
--- /dev/null
+++ b/lib/node_modules/@stdlib/random/base/pcg32/lib/native.js
@@ -0,0 +1,78 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2026 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+'use strict';
+
+// MODULES //
+
+var Float64Array = require( '@stdlib/array/float64' );
+var Uint32Array = require( '@stdlib/array/uint32' );
+var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
+var addon = require( './../src/addon.node' );
+
+
+// MAIN //
+
+/**
+* Generates a sequence of pseudorandom 32-bit unsigned integers using the native PCG32 implementation.
+*
+* @private
+* @param {PRNGSeedPCG32} seed - generator seed
+* @param {NonNegativeInteger} n - number of values to generate
+* @returns {Uint32Array} pseudorandom integers
+*
+* @example
+* var out = pcg32( 1234, 10 );
+* // returns
+*/
+function pcg32( seed, n ) {
+ var out = new Uint32Array( n );
+ if ( typeof seed === 'number' ) {
+ seed = [ seed ];
+ }
+ addon( new Uint32Array( seed ), out );
+ return out;
+}
+
+/**
+* Generates a sequence of normalized pseudorandom double-precision floating-point numbers using the native PCG32 implementation.
+*
+* @private
+* @param {PRNGSeedPCG32} seed - generator seed
+* @param {NonNegativeInteger} n - number of values to generate
+* @returns {Float64Array} pseudorandom numbers on the interval `[0,1)`
+*
+* @example
+* var out = pcg32.normalized( 1234, 10 );
+* // returns
+*/
+function normalized( seed, n ) {
+ var out = new Float64Array( n );
+ if ( typeof seed === 'number' ) {
+ seed = [ seed ];
+ }
+ addon.normalized( new Uint32Array( seed ), out );
+ return out;
+}
+
+setReadOnly( pcg32, 'normalized', normalized );
+
+
+// EXPORTS //
+
+module.exports = pcg32;
diff --git a/lib/node_modules/@stdlib/random/base/pcg32/lib/rand_uint32.js b/lib/node_modules/@stdlib/random/base/pcg32/lib/rand_uint32.js
new file mode 100644
index 000000000000..ac293203d0c4
--- /dev/null
+++ b/lib/node_modules/@stdlib/random/base/pcg32/lib/rand_uint32.js
@@ -0,0 +1,53 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2026 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+'use strict';
+
+// MODULES //
+
+var UINT32_MAX = require( '@stdlib/constants/uint32/max' );
+var floor = require( '@stdlib/math/base/special/floor' );
+
+
+// VARIABLES //
+
+var MAX = UINT32_MAX + 1;
+
+
+// MAIN //
+
+/**
+* Returns a pseudorandom integer on the interval \\( [0, 2^{32}) \\).
+*
+* @private
+* @returns {NonNegativeInteger} pseudorandom integer
+*
+* @example
+* var v = randuint32();
+* // returns
+*/
+function randuint32() {
+ // #TODO: Don't use floor, >>> can suffice
+ var v = floor( MAX * Math.random() ); // eslint-disable-line stdlib/no-builtin-math
+ return v >>> 0; // asm type annotation
+}
+
+
+// EXPORTS //
+
+module.exports = randuint32;
diff --git a/lib/node_modules/@stdlib/random/base/pcg32/manifest.json b/lib/node_modules/@stdlib/random/base/pcg32/manifest.json
new file mode 100644
index 000000000000..28cf12168484
--- /dev/null
+++ b/lib/node_modules/@stdlib/random/base/pcg32/manifest.json
@@ -0,0 +1,75 @@
+{
+ "options": {
+ "task": "build"
+ },
+ "fields": [
+ {
+ "field": "src",
+ "resolve": true,
+ "relative": true
+ },
+ {
+ "field": "include",
+ "resolve": true,
+ "relative": true
+ },
+ {
+ "field": "libraries",
+ "resolve": false,
+ "relative": false
+ },
+ {
+ "field": "libpath",
+ "resolve": true,
+ "relative": false
+ }
+ ],
+ "confs": [
+ {
+ "task": "build",
+ "src": [
+ "./src/main.c"
+ ],
+ "include": [
+ "./include"
+ ],
+ "libraries": [],
+ "libpath": [],
+ "dependencies": [
+ "@stdlib/random/base/shared",
+ "@stdlib/napi/argv",
+ "@stdlib/napi/argv-uint32array",
+ "@stdlib/napi/argv-float64array",
+ "@stdlib/napi/export"
+ ]
+ },
+ {
+ "task": "benchmark",
+ "src": [
+ "./src/main.c"
+ ],
+ "include": [
+ "./include"
+ ],
+ "libraries": [],
+ "libpath": [],
+ "dependencies": [
+ "@stdlib/random/base/shared"
+ ]
+ },
+ {
+ "task": "examples",
+ "src": [
+ "./src/main.c"
+ ],
+ "include": [
+ "./include"
+ ],
+ "libraries": [],
+ "libpath": [],
+ "dependencies": [
+ "@stdlib/random/base/shared"
+ ]
+ }
+ ]
+}
diff --git a/lib/node_modules/@stdlib/random/base/pcg32/package.json b/lib/node_modules/@stdlib/random/base/pcg32/package.json
new file mode 100644
index 000000000000..ff964910bd16
--- /dev/null
+++ b/lib/node_modules/@stdlib/random/base/pcg32/package.json
@@ -0,0 +1,75 @@
+{
+ "name": "@stdlib/random/base/pcg32",
+ "version": "0.0.0",
+ "description": "A 32-bit permuted congruential pseudorandom number generator (PCG) based on O’Neill.",
+ "license": "Apache-2.0",
+ "author": {
+ "name": "The Stdlib Authors",
+ "url": "https://github.com/stdlib-js/stdlib/graphs/contributors"
+ },
+ "contributors": [
+ {
+ "name": "The Stdlib Authors",
+ "url": "https://github.com/stdlib-js/stdlib/graphs/contributors"
+ }
+ ],
+ "main": "./lib",
+ "directories": {
+ "benchmark": "./benchmark",
+ "doc": "./docs",
+ "example": "./examples",
+ "include": "./include",
+ "lib": "./lib",
+ "src": "./src",
+ "test": "./test"
+ },
+ "types": "./docs/types",
+ "scripts": {},
+ "homepage": "https://github.com/stdlib-js/stdlib",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/stdlib-js/stdlib.git"
+ },
+ "bugs": {
+ "url": "https://github.com/stdlib-js/stdlib/issues"
+ },
+ "dependencies": {},
+ "devDependencies": {},
+ "engines": {
+ "node": ">=0.10.0",
+ "npm": ">2.7.0"
+ },
+ "os": [
+ "aix",
+ "darwin",
+ "freebsd",
+ "linux",
+ "macos",
+ "openbsd",
+ "sunos",
+ "win32",
+ "windows"
+ ],
+ "keywords": [
+ "stdlib",
+ "stdmath",
+ "mathematics",
+ "math",
+ "statistics",
+ "stats",
+ "prng",
+ "pseudorandom",
+ "random",
+ "rand",
+ "randint",
+ "randu",
+ "uniform",
+ "generator",
+ "lcg",
+ "pcg",
+ "pcg32",
+ "oneill",
+ "seed",
+ "seedable"
+ ]
+}
diff --git a/lib/node_modules/@stdlib/random/base/pcg32/src/Makefile b/lib/node_modules/@stdlib/random/base/pcg32/src/Makefile
new file mode 100644
index 000000000000..2caf905cedbe
--- /dev/null
+++ b/lib/node_modules/@stdlib/random/base/pcg32/src/Makefile
@@ -0,0 +1,70 @@
+#/
+# @license Apache-2.0
+#
+# Copyright (c) 2026 The Stdlib Authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#/
+
+# VARIABLES #
+
+ifndef VERBOSE
+ QUIET := @
+else
+ QUIET :=
+endif
+
+# Determine the OS ([1][1], [2][2]).
+#
+# [1]: https://en.wikipedia.org/wiki/Uname#Examples
+# [2]: http://stackoverflow.com/a/27776822/2225624
+OS ?= $(shell uname)
+ifneq (, $(findstring MINGW,$(OS)))
+ OS := WINNT
+else
+ifneq (, $(findstring MSYS,$(OS)))
+ OS := WINNT
+else
+ifneq (, $(findstring CYGWIN,$(OS)))
+ OS := WINNT
+else
+ifneq (, $(findstring Windows_NT,$(OS)))
+ OS := WINNT
+endif
+endif
+endif
+endif
+
+
+# RULES #
+
+#/
+# Removes generated files for building an add-on.
+#
+# @example
+# make clean-addon
+#/
+clean-addon:
+ $(QUIET) -rm -f *.o *.node
+
+.PHONY: clean-addon
+
+#/
+# Removes generated files.
+#
+# @example
+# make clean
+#/
+clean: clean-addon
+
+.PHONY: clean
diff --git a/lib/node_modules/@stdlib/random/base/pcg32/src/addon.c b/lib/node_modules/@stdlib/random/base/pcg32/src/addon.c
new file mode 100644
index 000000000000..18e83615e97a
--- /dev/null
+++ b/lib/node_modules/@stdlib/random/base/pcg32/src/addon.c
@@ -0,0 +1,94 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2026 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#include "stdlib/random/base/pcg32.h"
+#include "stdlib/random/base/shared.h"
+#include "stdlib/napi/export.h"
+#include "stdlib/napi/argv.h"
+#include "stdlib/napi/argv_float64array.h"
+#include "stdlib/napi/argv_uint32array.h"
+#include
+#include
+
+/**
+* Receives JavaScript callback invocation data.
+*
+* @param env environment under which the function is invoked
+* @param info callback data
+* @return Node-API value
+*/
+static napi_value addon( napi_env env, napi_callback_info info ) {
+ STDLIB_NAPI_ARGV( env, info, argv, argc, 2 );
+ STDLIB_NAPI_ARGV_UINT32ARRAY( env, seed, seedLen, argv, 0 );
+ STDLIB_NAPI_ARGV_UINT32ARRAY( env, out, len, argv, 1 );
+
+ struct BasePRNGObject *obj = stdlib_base_random_pcg32_allocate( seed, seedLen );
+ if ( obj == NULL ) {
+ napi_throw_error( env, NULL, "unable to allocate PRNG" );
+ return NULL;
+ }
+
+ uint64_t v;
+ int64_t i;
+ for ( i = 0; i < len; i++ ) {
+ if ( obj->prng->next( obj, &v ) != 0 ) {
+ stdlib_base_random_pcg32_free( obj );
+ napi_throw_error( env, NULL, "unexpected PRNG failure" );
+ return NULL;
+ }
+ out[ i ] = (uint32_t)v;
+ }
+
+ stdlib_base_random_pcg32_free( obj );
+ return NULL;
+}
+
+/**
+* Receives JavaScript callback invocation data.
+*
+* @param env environment under which the function is invoked
+* @param info callback data
+* @return Node-API value
+*/
+static napi_value addon_normalized( napi_env env, napi_callback_info info ) {
+ STDLIB_NAPI_ARGV( env, info, argv, argc, 2 );
+ STDLIB_NAPI_ARGV_UINT32ARRAY( env, seed, seedLen, argv, 0 );
+ STDLIB_NAPI_ARGV_FLOAT64ARRAY( env, out, len, argv, 1 );
+
+ struct BasePRNGObject *obj = stdlib_base_random_pcg32_allocate( seed, seedLen );
+ if ( obj == NULL ) {
+ napi_throw_error( env, NULL, "unable to allocate PRNG" );
+ return NULL;
+ }
+
+ double v;
+ int64_t i;
+ for ( i = 0; i < len; i++ ) {
+ if ( obj->prng->normalized( obj, &v ) != 0 ) {
+ stdlib_base_random_pcg32_free( obj );
+ napi_throw_error( env, NULL, "unexpected PRNG failure" );
+ return NULL;
+ }
+ out[ i ] = v;
+ }
+
+ stdlib_base_random_pcg32_free( obj );
+ return NULL;
+}
+
+STDLIB_NAPI_MODULE_EXPORT_FCN_WITH_METHOD( addon, "normalized", addon_normalized )
diff --git a/lib/node_modules/@stdlib/random/base/pcg32/src/main.c b/lib/node_modules/@stdlib/random/base/pcg32/src/main.c
new file mode 100644
index 000000000000..aa2ec0a58dde
--- /dev/null
+++ b/lib/node_modules/@stdlib/random/base/pcg32/src/main.c
@@ -0,0 +1,617 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2026 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#include "stdlib/random/base/pcg32.h"
+#include "stdlib/random/base/shared.h"
+#include
+#include
+#include
+
+// Forward declarations:
+static inline int8_t next( struct BasePRNGObject *obj, uint64_t *out );
+static inline int8_t normalized( struct BasePRNGObject *obj, double *out );
+static inline void pcg32_free( struct BasePRNGObject *obj );
+
+// Define the LCG multiplier: Ref: https://github.com/imneme/pcg-c/blob/83252d9c23df9c82ecb42210afed61a7b42402d7/include/pcg_variants.h#L279
+static const uint64_t MULTIPLIER = 0x5851f42d4c957f2dULL;
+
+// Define the default LCG increment: Ref: https://github.com/imneme/pcg-c/blob/83252d9c23df9c82ecb42210afed61a7b42402d7/include/pcg_variants.h#L284
+static const uint64_t DEFAULT_INCREMENT = 0x14057b7ef767814fULL;
+
+// Define the maximum 32-bit unsigned integer: 4294967295 => 0xffffffff => 11111111111111111111111111111111
+static const uint32_t MAX_UINT32 = 0xffffffff;
+
+// Define the normalization constant:
+static const double NORMALIZATION_CONSTANT = 1.0 / ( MAX_UINT32+1.0 );
+
+/**
+* PCG32 PRNG.
+*
+*/
+static const struct BasePRNG pcg32_prng = {
+ "pcg32", // name
+ (uint64_t)0, // min
+ (uint64_t)MAX_UINT32, // max: 2^{32}-1
+ 0.0, // min (normalized)
+ MAX_UINT32 * NORMALIZATION_CONSTANT, // max (normalized): (2^{32}-1)/2^{32}
+ sizeof( stdlib_base_random_pcg32_state_t ), // state_size
+ &next, // next()
+ &normalized, // normalized()
+ &pcg32_free // free()
+};
+
+/**
+* Returns a pseudorandom integer.
+*
+* ## Notes
+*
+* - The function returns `-1` if unable to generate a pseudorandom integer and `0` otherwise.
+*
+* ## References
+*
+* - O’Neill, Melissa E. 2014. “PCG: A Family of Simple Fast Space-Efficient Statistically Good Algorithms for Random Number Generation.” Technical Report HMC-CS-2014-0905. Harvey Mudd College, Claremont, CA. [https://www.cs.hmc.edu/tr/hmc-cs-2014-0905.pdf](https://www.cs.hmc.edu/tr/hmc-cs-2014-0905.pdf).
+*
+* @param obj PRNG object
+* @param out output address
+* @return status code
+*/
+static inline int8_t next( struct BasePRNGObject *obj, uint64_t *out ) {
+ uint32_t xorshifted;
+ uint64_t oldstate;
+ uint32_t output;
+ uint32_t rot;
+
+ if ( obj == NULL || obj->prng != &pcg32_prng ) {
+ return -1;
+ }
+ // Retrieve the state object:
+ stdlib_base_random_pcg32_state_t *so = (stdlib_base_random_pcg32_state_t *)( obj->state );
+
+ // Retrieve the current state:
+ oldstate = so->state;
+
+ // Update the PRNG state:
+ so->state = oldstate * MULTIPLIER + so->increment;
+
+ // Apply output permutaion (XSH-RR)
+ xorshifted = ( ( oldstate >> 18 ) ^ oldstate ) >> 27;
+ rot = oldstate >> 59;
+ output = ( xorshifted >> rot ) | ( xorshifted << ( -rot & 31 ) ); // Rotate right
+
+ // Set the output value:
+ *out = (uint64_t)output;
+
+ return 0;
+}
+
+/**
+* Returns a pseudorandom double-precision floating-point number on the interval `[0, 1)`.
+*
+* ## Notes
+*
+* - The function returns `-1` if unable to generate a pseudorandom number and `0` otherwise.
+*
+* @param obj PRNG object
+* @param out output address
+* @return status code
+*/
+static inline int8_t normalized( struct BasePRNGObject *obj, double *out ) {
+ uint64_t x;
+ int8_t status = next( obj, &x );
+ if ( status != 0 ) {
+ return -1;
+ }
+ // Note: casting `x` to a double here is fine, as `x` will never exceed the maximum "safe" double-precision floating-point number:
+ *out = (double)x * NORMALIZATION_CONSTANT;
+
+ return 0;
+}
+
+/**
+* Frees a PRNG's allocated memory.
+*
+* @param obj PRNG object
+*/
+static inline void pcg32_free( struct BasePRNGObject *obj ) {
+ if ( obj == NULL || obj->prng != &pcg32_prng ) {
+ return;
+ }
+ stdlib_base_random_pcg32_state_t *state = (stdlib_base_random_pcg32_state_t *)( obj->state );
+ free( state->seed );
+ free( obj->state );
+ free( obj );
+}
+
+/**
+* Returns a pointer to a dynamically allocated PRNG.
+*
+* ## Notes
+*
+* - The user is responsible for freeing the allocated memory.
+*
+* @param seed pointer to a seed array
+* @param len seed array length
+* @return pointer to a dynamically allocated PRNG or, if unable to allocate memory, a null pointer
+*
+* @example
+* #include "stdlib/random/base/pcg32.h"
+* #include "stdlib/random/base/shared.h"
+* #include
+* #include
+* #include
+*
+* // Define a PRNG seed:
+* uint32_t seed[] = { 1234 };
+*
+* // Create a PRNG:
+* struct BasePRNGObject *obj = stdlib_base_random_pcg32_allocate( seed, 1 );
+* if ( obj == NULL ) {
+* fprintf( stderr, "Error allocating memory.\n" );
+* exit( 1 );
+* }
+*
+* uint64_t r;
+* int8_t status = obj->prng->next( obj, &r );
+* if ( status != 0 ) {
+* fprintf( stderr, "Unexpected result.\n" );
+* exit( 1 );
+* }
+*
+* // ...
+*
+* status = obj->prng->next( obj, &r );
+*
+* // ...
+*
+* status = obj->prng->next( obj, &r );
+*
+* // ...
+*
+* // Free allocated memory:
+* stdlib_base_random_pcg32_free( obj );
+*/
+struct BasePRNGObject * stdlib_base_random_pcg32_allocate( const uint32_t *seed, const int64_t len ) {
+ stdlib_base_random_pcg32_state_t *state;
+ struct BasePRNGObject *obj;
+ uint64_t output;
+ uint32_t *iseed;
+
+ obj = malloc( sizeof( struct BasePRNGObject ) );
+ if ( obj == NULL ) {
+ return NULL;
+ }
+ state = malloc( sizeof( stdlib_base_random_pcg32_state_t ) );
+ if ( state == NULL ) {
+ free( obj ); // prevent memory leaks
+ return NULL;
+ }
+ obj->prng = &pcg32_prng;
+ obj->state = state;
+
+ // Create an internal copy of the provided seed array to prevent the inability to reproduce PRNG values based on the PRNG's stated seed due to external state mutation:
+ iseed = (uint32_t *)malloc( sizeof( uint32_t )*len );
+ if ( iseed == NULL ) {
+ free( obj ); // prevent memory leaks
+ free( state );
+ return NULL;
+ }
+ memcpy( iseed, seed, sizeof( uint32_t )*len );
+ state->seed = iseed;
+ state->seed_length = len;
+
+ // Initialize the internal PRNG state:
+ state->state = 0;
+ // Initialize the LCG increment:
+ if ( len < 3 ) {
+ state->increment = DEFAULT_INCREMENT;
+ }
+ else {
+ if ( len > 3 ) {
+ state->increment = ( (uint64_t)seed[ 2 ] << 32 ) | (uint64_t)seed[ 3 ];
+ }
+ else {
+ state->increment = (uint64_t)seed[ 2 ];
+ }
+ // Ensure the increment is an odd number:
+ state->increment = (state->increment << 1) | 1;
+ }
+ // Run PCG warm-up sequence:
+ next( obj, &output );
+ if ( len > 1 ) {
+ state->state += ( (uint64_t)seed[ 0 ] << 32 ) | (uint64_t)seed[ 1 ];
+ }
+ else {
+ state->state += (uint64_t)seed[ 0 ];
+ }
+ next( obj, &output );
+
+ return obj;
+}
+
+/**
+* Frees a PRNG's allocated memory.
+*
+* @param obj PRNG object
+*
+* @example
+* #include "stdlib/random/base/pcg32.h"
+* #include "stdlib/random/base/shared.h"
+* #include
+* #include
+* #include
+*
+* // Define a PRNG seed:
+* uint32_t seed[] = { 1234 };
+*
+* // Create a PRNG:
+* struct BasePRNGObject *obj = stdlib_base_random_pcg32_allocate( seed, 1 );
+* if ( obj == NULL ) {
+* fprintf( stderr, "Error allocating memory.\n" );
+* exit( 1 );
+* }
+*
+* uint64_t r;
+* int8_t status = obj->prng->next( obj, &r );
+* if ( status != 0 ) {
+* fprintf( stderr, "Unexpected result.\n" );
+* exit( 1 );
+* }
+*
+* // ...
+*
+* status = obj->prng->next( obj, &r );
+*
+* // ...
+*
+* status = obj->prng->next( obj, &r );
+*
+* // ...
+*
+* // Free allocated memory:
+* stdlib_base_random_pcg32_free( obj );
+*/
+void stdlib_base_random_pcg32_free( struct BasePRNGObject *obj ) {
+ if ( obj == NULL || obj->prng != &pcg32_prng ) {
+ return;
+ }
+ obj->prng->free( obj );
+}
+
+/**
+* Returns the PRNG seed length.
+*
+* ## Notes
+*
+* - The function returns `-1` if unable to resolve a PRNG seed length and `0` otherwise.
+*
+* @param obj PRNG object
+* @param len output address
+* @return status code
+*
+* @example
+* #include "stdlib/random/base/pcg32.h"
+* #include "stdlib/random/base/shared.h"
+* #include
+* #include
+* #include
+*
+* // Define a PRNG seed:
+* uint32_t seed1[] = { 1234 };
+*
+* // Create a PRNG:
+* struct BasePRNGObject *obj = stdlib_base_random_pcg32_allocate( seed1, 1 );
+* if ( obj == NULL ) {
+* fprintf( stderr, "Error allocating memory.\n" );
+* exit( 1 );
+* }
+*
+* // ...
+*
+* // Get the seed length:
+* int64_t seed_length;
+* int8_t status = stdlib_base_random_pcg32_seed_length( obj, &seed_length );
+* if ( status != 0 ) {
+* fprintf( stderr, "Error encountered when attempting to retrieve the PRNG seed length.\n" );
+* exit( 1 );
+* }
+*
+* // Get the PRNG seed:
+* uint32_t *seed2 = (uint32_t *)malloc( sizeof( uint32_t )*seed_length );
+* if ( seed2 == NULL ) {
+* fprintf( stderr, "Error allocating memory.\n" );
+* exit( 1 );
+* }
+* status = stdlib_base_random_pcg32_seed( obj, seed2 );
+* if ( status != 0 ) {
+* fprintf( stderr, "Error encountered when attempting to retrieve the PRNG seed.\n" );
+* exit( 1 );
+* }
+*
+* // Use the seed to, e.g., create another PRNG which will generate the same sequence...
+*
+* // Free allocated memory:
+* stdlib_base_random_pcg32_free( obj );
+* free( seed2 );
+*/
+int8_t stdlib_base_random_pcg32_seed_length( const struct BasePRNGObject *obj, int64_t *len ) {
+ if ( obj == NULL || obj->prng != &pcg32_prng ) {
+ return -1;
+ }
+ // Retrieve the state object:
+ const stdlib_base_random_pcg32_state_t *state = (stdlib_base_random_pcg32_state_t *)( obj->state );
+
+ // Set the seed length:
+ *len = (int64_t)( state->seed_length );
+
+ return 0;
+}
+
+/**
+* Returns a PRNG seed.
+*
+* ## Notes
+*
+* - The function returns `-1` if unable to resolve a PRNG seed and `0` otherwise.
+*
+* @param obj PRNG object
+* @param seed output address
+* @return status code
+*
+* @example
+* #include "stdlib/random/base/pcg32.h"
+* #include "stdlib/random/base/shared.h"
+* #include
+* #include
+* #include
+*
+* // Define a PRNG seed:
+* uint32_t seed1[] = { 1234 };
+*
+* // Create a PRNG:
+* struct BasePRNGObject *obj = stdlib_base_random_pcg32_allocate( seed1, 1 );
+* if ( obj == NULL ) {
+* fprintf( stderr, "Error allocating memory.\n" );
+* exit( 1 );
+* }
+*
+* // ...
+*
+* // Get the seed length:
+* int64_t seed_length;
+* int8_t status = stdlib_base_random_pcg32_seed_length( obj, &seed_length );
+* if ( status != 0 ) {
+* fprintf( stderr, "Error encountered when attempting to retrieve the PRNG seed length.\n" );
+* exit( 1 );
+* }
+*
+* // Get the PRNG seed:
+* uint32_t *seed2 = (uint32_t *)malloc( sizeof( uint32_t )*seed_length );
+* if ( seed2 == NULL ) {
+* fprintf( stderr, "Error allocating memory.\n" );
+* exit( 1 );
+* }
+* status = stdlib_base_random_pcg32_seed( obj, seed2 );
+* if ( status != 0 ) {
+* fprintf( stderr, "Error encountered when attempting to retrieve the PRNG seed.\n" );
+* exit( 1 );
+* }
+*
+* // Use the seed to, e.g., create another PRNG which will generate the same sequence...
+*
+* // Free allocated memory:
+* stdlib_base_random_pcg32_free( obj );
+* free( seed2 );
+*/
+int8_t stdlib_base_random_pcg32_seed( const struct BasePRNGObject *obj, uint32_t *seed ) {
+ if ( obj == NULL || obj->prng != &pcg32_prng ) {
+ return -1;
+ }
+ // Retrieve the state object:
+ const stdlib_base_random_pcg32_state_t *state = (stdlib_base_random_pcg32_state_t *)( obj->state );
+
+ // Copy the seed array:
+ memcpy( seed, state->seed, sizeof( uint32_t )*(state->seed_length) );
+
+ return 0;
+}
+
+/**
+* Returns a **copy** of the current PRNG state.
+*
+* ## Notes
+*
+* - The user is responsible for freeing the allocated memory.
+*
+* @param obj PRNG object
+* @return pointer to a copy of the PRNG's internal state or, if unable to allocate memory, a null pointer
+*
+* @example
+* #include "stdlib/random/base/pcg32.h"
+* #include "stdlib/random/base/shared.h"
+* #include
+* #include
+* #include
+*
+* // Define a PRNG seed:
+* uint32_t seed[] = { 1234 };
+*
+* // Create a PRNG:
+* struct BasePRNGObject *obj = stdlib_base_random_pcg32_allocate( seed, 1 );
+* if ( obj == NULL ) {
+* fprintf( stderr, "Error allocating memory.\n" );
+* exit( 1 );
+* }
+*
+* stdlib_base_random_pcg32_state_t *state = (stdlib_base_random_pcg32_state_t *)stdlib_base_random_pcg32_state( obj );
+* if ( state == NULL ) {
+* fprintf( stderr, "Unable to retrieve PRNG state.\n" );
+* exit( 1 );
+* }
+*
+* // Use the captured state to, e.g., sync another PRNG or to reset a PRNG to a particular state in order to "replay" generated values at a later point in time...
+*
+* // Free allocated memory:
+* stdlib_base_random_pcg32_free( obj );
+*
+* free( state->seed );
+* free( state );
+*/
+void * stdlib_base_random_pcg32_state( const struct BasePRNGObject *obj ) {
+ const stdlib_base_random_pcg32_state_t *so;
+ stdlib_base_random_pcg32_state_t *state;
+ uint64_t nbytes;
+ uint32_t *seed;
+ if ( obj == NULL || obj->prng != &pcg32_prng ) {
+ return NULL;
+ }
+ state = (stdlib_base_random_pcg32_state_t *)malloc( obj->prng->state_size );
+ if ( state == NULL ) {
+ return NULL;
+ }
+ nbytes = sizeof( uint32_t ) * (state->seed_length);
+ seed = (uint32_t *)malloc( nbytes );
+ if ( seed == NULL ) {
+ free( state ); // prevent memory leaks
+ return NULL;
+ }
+ // Copy the state:
+ memcpy( state, obj->state, obj->prng->state_size );
+
+ // Explicitly copy the seed array to prevent external mutation:
+ so = (stdlib_base_random_pcg32_state_t *)( obj->state );
+ memcpy( seed, so->seed, nbytes );
+ state->seed = seed;
+
+ return (void *)state;
+}
+
+/**
+* Sets the PRNG state.
+*
+* ## Notes
+*
+* - The function returns `-1` if unable to set a PRNG state and `0` otherwise.
+*
+* @param obj PRNG object
+* @param state state
+* @return status code
+*
+* @example
+* #include "stdlib/random/base/pcg32.h"
+* #include "stdlib/random/base/shared.h"
+* #include
+* #include
+* #include
+*
+* // Define a PRNG seed:
+* uint32_t seed[] = { 1234 };
+*
+* // Create a PRNG:
+* struct BasePRNGObject *obj = stdlib_base_random_pcg32_allocate( seed, 1 );
+* if ( obj == NULL ) {
+* fprintf( stderr, "Error allocating memory.\n" );
+* exit( 1 );
+* }
+*
+* uint64_t r;
+* int8_t status = obj->prng->next( obj, &r );
+* if ( status != 0 ) {
+* fprintf( stderr, "Unexpected result.\n" );
+* exit( 1 );
+* }
+*
+* // ...
+*
+* status = obj->prng->next( obj, &r );
+*
+* // ...
+*
+* status = obj->prng->next( obj, &r );
+*
+* // ...
+*
+* // Retrieve the current PRNG state...
+* stdlib_base_random_pcg32_state_t *state = (stdlib_base_random_pcg32_state_t *)stdlib_base_random_pcg32_state( obj );
+* if ( state == NULL ) {
+* fprintf( stderr, "Error encountered when attempting to retrieve PRNG state.\n" );
+* exit( 1 );
+* }
+*
+* // ...
+*
+* status = obj->prng->next( obj, &r );
+*
+* // ...
+*
+* status = obj->prng->next( obj, &r );
+*
+* // ...
+*
+* // Reset the PRNG to a previous state...
+* status = stdlib_base_random_pcg32_set( obj, (void *)state );
+* if ( status != 0 ) {
+* fprintf( stderr, "Error encountered when attempting to set PRNG state.\n" );
+* exit( 1 );
+* }
+*
+* // ...
+*
+* status = obj->prng->next( obj, &r );
+*
+* // ...
+*
+* status = obj->prng->next( obj, &r );
+*
+* // ...
+*
+* // Free allocated memory:
+* stdlib_base_random_pcg32_free( obj );
+*
+* free( state->seed );
+* free( state );
+*/
+int8_t stdlib_base_random_pcg32_set( struct BasePRNGObject *obj, const void *state ) {
+ stdlib_base_random_pcg32_state_t *vstate;
+ uint64_t nbytes;
+ uint32_t *seed;
+ if ( obj == NULL || state == NULL || obj->prng != &pcg32_prng ) {
+ return -1;
+ }
+ // Copy the provided seed array:
+ vstate = ( stdlib_base_random_pcg32_state_t *)state;
+ nbytes = sizeof( uint32_t ) * ( vstate->seed_length );
+ seed = (uint32_t *)malloc( nbytes );
+ if ( seed == NULL ) {
+ return -1;
+ }
+ memcpy( seed, vstate->seed, nbytes );
+
+ // Retrieve the current PRNG state:
+ vstate = ( stdlib_base_random_pcg32_state_t *)( obj->state );
+
+ // Free the memory held by the current seed array:
+ free( vstate->seed );
+
+ // Overwrite the current state with the provided state:
+ memcpy( vstate, state, obj->prng->state_size );
+
+ // Update the seed array pointer:
+ vstate->seed = seed;
+
+ return 0;
+}
diff --git a/lib/node_modules/@stdlib/random/base/pcg32/test/fixtures/float64_array_seed.json b/lib/node_modules/@stdlib/random/base/pcg32/test/fixtures/float64_array_seed.json
new file mode 100644
index 000000000000..0663055b08e4
--- /dev/null
+++ b/lib/node_modules/@stdlib/random/base/pcg32/test/fixtures/float64_array_seed.json
@@ -0,0 +1 @@
+{"seed":[291,564,837,1110],"expected":[0.72274035634472966,0.17183080967515707,0.71372631122358143,0.74147900426760316,0.031584638170897961,0.42686787294223905,0.44723058235831559,0.24527795356698334,0.76524244551546872,0.73249058239161968,0.17633350705727935,0.52122573787346482,0.84083158266730607,0.75498532108031213,0.073755680350586772,0.82255542255006731,0.14289952325634658,0.87428447441197932,0.43149935104884207,0.64741130894981325,0.30218583857640624,0.091020140796899796,0.37198406597599387,0.43744691810570657,0.29339567525312304,0.62449501315131783,0.64709100965410471,0.021320552797988057,0.99414164084009826,0.28139363043010235,0.22453265660442412,0.19834348652511835,0.85117048234678805,0.57079552463255823,0.049669205211102962,0.97053798940032721,0.8569596151355654,0.50920716254040599,0.95152387581765652,0.012139905476942658,0.55333764781244099,0.68721961230039597,0.4243887800257653,0.74086135136894882,0.1500331275165081,0.51396562531590462,0.44879996427334845,0.35578537336550653,0.33208857825957239,0.61706735868938267,0.86456472403369844,0.37205007066950202,0.81366899679414928,0.12214922509156168,0.14048191462643445,0.67652629339136183,0.10228568967431784,0.32831117091700435,0.01109669404104352,0.56583252362906933,0.91381424688734114,0.14037123788148165,0.65789613639935851,0.43200075509957969,0.38933487143367529,0.68698734161444008,0.52080686273984611,0.22245304426178336,0.28134985570795834,0.84887603530660272,0.63703516381792724,0.17288169567473233,0.28295264230109751,0.68403239385224879,0.045800433494150639,0.65253009460866451,0.22494048881344497,0.14422932895831764,0.58969247620552778,0.88974443799816072,0.32417976157739758,0.75701622385531664,0.10003565298393369,0.8154483197722584,0.99995551235042512,0.93560557463206351,0.67044193972833455,0.45990498433820903,0.95254124724306166,0.91158766881562769,0.8231466009747237,0.81895476882345974,0.96804940002039075,0.49390786373987794,0.1156341815367341,0.51633012620732188,0.58186086150817573,0.63187188538722694,0.51924451161175966,0.076520362170413136,0.013717144960537553,0.81883464870043099,0.73819024907425046,0.20763796335086226,0.78549860278144479,0.44937824853695929,0.079572461312636733,0.10527283721603453,0.45815987722016871,0.80874064611271024,0.32216364075429738,0.29449758771806955,0.93601132184267044,0.5844973586499691,0.50067087099887431,0.6612439570017159,0.63967612944543362,0.81411825935356319,0.5127485366538167,0.30541863362304866,0.31512140040285885,0.50323311472311616,0.31574822752736509,0.96833714889362454,0.3287470368668437,0.33690655045211315,0.51173940463922918,0.096430239966139197,0.81643315614201128,0.25196751672774553,0.43475150386802852,0.66354616498574615,0.82037278008647263,0.18467106996104121,0.3895933146122843,0.59282959811389446,0.39407501532696187,0.4602539362385869,0.60759520507417619,0.99123501940630376,0.97078660875558853,0.35653063538484275,0.99278735974803567,0.56774714286439121,0.9120049390476197,0.13968194019980729,0.65478045446798205,0.72547591244801879,0.011213303310796618,0.15729782334528863,0.012768412241712213,0.96243327762931585,0.78142209374345839,0.73799169901758432,0.6366718434728682,0.97656216798350215,0.95943446247838438,0.63824037695303559,0.46964803617447615,0.0063818506896495819,0.93761635501869023,0.33663548133336008,0.99714123830199242,0.20791993080638349,0.37548415875062346,0.98181938193738461,0.89688508096151054,0.051995946792885661,0.31828921847045422,0.97823493834584951,0.74657260673120618,0.39776678243651986,0.18518418888561428,0.5138792737852782,0.5307656554505229,0.25675439485348761,0.53210724121890962,0.16631289874203503,0.29641076689586043,0.98636972345411777,0.84409077651798725,0.85558753833174706,0.70331744663417339,0.40579157904721797,0.56424847315065563,0.46933146542869508,0.35768432728946209,0.65739068109542131,0.046806469326838851,0.29985994566231966,0.34697042894549668,0.33025524881668389,0.2620395366102457,0.67120210570283234,0.79080939409323037,0.87600635294802487,0.93367018015123904,0.44116654410026968,0.67571153352037072,0.60641319141723216,0.40670684422366321,0.60948130255565047,0.43294637789949775,0.76895429426804185,0.60284786624833941,0.32473411201499403,0.5876989911776036,0.49995350954122841,0.60845398367382586,0.60912272986024618,0.19302084692753851,0.66961987921968102,0.91546764178201556,0.58796411193907261,0.18775175721384585,0.63582616322673857,0.76754586095921695,0.29940343578346074,0.35184735711663961,0.29535940242931247,0.10061271884478629,0.64425812009721994,0.24385392828844488,0.50276075978763402,0.97755279508419335,0.22623743838630617,0.66124423104338348,0.16473904391750693,0.89488680986687541,0.078321966808289289,0.59917089878581464,0.67704443051479757,0.61451644659973681,0.61900447867810726,0.43589963810518384,0.75693178689107299,0.8540420273784548,0.061018264852464199,0.80949240946210921,0.75525828637182713,0.30274687916971743,0.45667062723077834,0.73083134950138628,0.63965854700654745,0.56406629970297217,0.8829288175329566,0.49694757466204464,0.26835484057664871,0.16702835215255618,0.87559157540090382,0.57568495557643473,0.65793707687407732,0.72207948449067771,0.60121606918983161,0.52569062146358192,0.54043511254712939,0.81591336405836046,0.87397030671127141,0.81356189027428627,0.93631130084395409,0.64928908739238977,0.24788402300328016,0.68892495846375823,0.18463550973683596,0.38063867366872728,0.93928456935100257,0.094610076164826751,0.082959858234971762,0.35574892978183925,0.90548099647276103,0.19553871662355959,0.84639807813800871,0.04879222740419209,0.21269675716757774,0.17221215856261551,0.97025055740959942,0.9577383256983012,0.043413499835878611,0.1169626412447542,0.88568147271871567,0.9566883894149214,0.58748068497516215,0.61186398984864354,0.054096943233162165,0.47668061964213848,0.36621539969928563,0.3238466524053365,0.70034554554149508,0.41672305995598435,0.29968956299126148,0.066180589608848095,0.93857976607978344,0.85374075267463923,0.36625716206617653,0.61619478999637067,0.091230502817779779,0.55210229498334229,0.099401946878060699,0.22596344305202365,0.72503792331553996,0.92093688319437206,0.61101152491755784,0.59737620153464377,0.43117019161581993,0.33145953039638698,0.39563672803342342,0.4448750268202275,0.25130363297648728,0.29766618250869215,0.50637544062919915,0.92121721338480711,0.16599303996190429,0.16412043571472168,0.68812977080233395,0.94525024062022567,0.48803534149192274,0.88681020471267402,0.72870715730823576,0.25110452598892152,0.52729576407000422,0.33135477500036359,0.30339006381109357,0.77776870131492615,0.36814611684530973,0.87667669216170907,0.92159307654947042,0.98084448208101094,0.38295116391964257,0.29198278533294797,0.4916281693149358,0.94763671280816197,0.99973962712101638,0.26725007407367229,0.7538620310369879,0.60399648756720126,0.23717172769829631,0.47247209679335356,0.65012264554388821,0.43471389310434461,0.21392812230624259,0.21790117281489074,0.014226869912818074,0.019564229529350996,0.95391376689076424,0.42441655066795647,0.020513704512268305,0.18954529170878232,0.03658882831223309,0.38667778763920069,0.51289454731158912,0.97616628604009748,0.96564605087041855,0.98376409523189068,0.49225462158210576,0.64935777359642088,0.19311906187795103,0.63174280244857073,0.049561867024749517,0.80408115312457085,0.67841985961422324,0.087212479440495372,0.090526685817167163,0.062597654294222593,0.12908890540711582,0.67416971316561103,0.84399055200628936,0.51943131699226797,0.33586081769317389,0.71570870513096452,0.56014465726912022,0.033766090404242277,0.42900943686254323,0.22098304843530059,0.46759384544566274,0.39456793153658509,0.99720894731581211,0.20867968630045652,0.88641135068610311,0.86161327129229903,0.84479559399187565,0.68816391099244356,0.33362457412295043,0.97879822878167033,0.90070838411338627,0.008974611759185791,0.30232034693472087,0.53969175834208727,0.29333345172926784,0.89604103844612837,0.77288683387450874,0.087863697204738855,0.73467206070199609,0.21064066677354276,0.73967452184297144,0.85607994068413973,0.49386286386288702,0.38378436956554651,0.79032392334192991,0.10185197275131941,0.95933293597772717,0.44038466410711408,0.96789751551114023,0.91050440329127014,0.96528905048035085,0.87330741668120027,0.39250447042286396,0.32250454253517091,0.8907282673753798,0.042461750097572803,0.10328685329295695,0.21564672421664,0.82173137040808797,0.34846522379666567,0.99424083856865764,0.79553501401096582,0.54762231232598424,0.0067128599621355534,0.45890251500532031,0.26705778180621564,0.81080467998981476,0.60459440108388662,0.84582101320847869,0.048579872818663716,0.65317533840425313,0.034175920067355037,0.28274450078606606,0.89635441219434142,0.50618530879728496,0.55536213843151927,0.14354044175706804,0.12895984505303204,0.62989175552502275,0.62232251791283488,0.21928537893109024,0.78320606052875519,0.86422648373991251,0.19146340480074286,0.55554483481682837,0.69941177894361317,0.88699173927307129,0.64021836477331817,0.12994682043790817,0.22154007852077484,0.56454511429183185,0.59295969665981829,0.39026474743150175,0.19946222612634301,0.87546366243623197,0.001285152742639184,0.56183274951763451,0.35623221914283931,0.3878982977475971,0.56085451715625823,0.34186634584330022,0.51515768398530781,0.79916658787988126,0.51809236221015453,0.18227680469863117,0.29010362434200943,0.40729973535053432,0.19706592080183327,0.072048092959448695,0.025260187452659011,0.86685249209403992,0.7818366379942745,0.75266506662592292,0.24943148624151945,0.85200068075209856,0.66704570269212127,0.68889195588417351,0.68433324387297034,0.12542160786688328,0.21935283858329058,0.15815309528261423,0.45126609760336578,0.90112839546054602,0.83240043860860169,0.64576174737885594,0.012469104491174221,0.71848549833521247,0.93342107464559376,0.44893486541695893,0.058868835680186749,0.7684060730971396,0.30347839742898941,0.30525269242934883,0.11951761017553508,0.54226507898420095,0.029310866957530379,0.3255720199085772,0.21592797967605293,0.76737048639915884,0.63329164427705109,0.094544198829680681,0.60700508882291615,0.53401368600316346,0.25480001280084252,0.52221657894551754,0.21770329750142992,0.97118717920966446,0.29683182458393276,0.47060422389768064,0.68570604082196951,0.84168026619590819,0.48731749108992517,0.066856160527095199,0.57057732297107577,0.72230405989103019,0.71642252546735108,0.50798935536295176,0.51637042756192386,0.096710217883810401,0.19210391421802342,0.68770741997286677,0.72166354302316904,0.99610627791844308,0.029218557989224792,0.60121130989864469,0.12943476182408631,0.79869900271296501,0.29579837992787361,0.86172249400988221,0.12755954428575933,0.49983935616910458,0.31427579117007554,0.99020232330076396,0.9601357018109411,0.24018807616084814,0.3042140738107264,0.44251793366856873,0.31258401763625443,0.13342255796305835,0.88018986512906849,0.33479879307560623,0.10443528555333614,0.5983554155100137,0.53672790061682463,0.74547888920642436,0.13087770086713135,0.026166846975684166,0.06246476829983294,0.0064776861108839512,0.65379982115700841,0.082849557511508465,0.87984943017363548,0.60399230034090579,0.21195526514202356,0.92911470867693424,0.45215151738375425,0.40543319704011083,0.73685757350176573,0.12364845769479871,0.978375333128497,0.58525088476017118,0.94359320681542158,0.78258661227300763,0.17126563563942909,0.7880741951521486,0.672238998580724,0.19973717746324837,0.296934531070292,0.90929721225984395,0.57281915587373078,0.097628221148625016,0.7637034123763442,0.00076900655403733253,0.14308947138488293,0.49177250475622714,0.094725423725321889,0.24845138005912304,0.79190456727519631,0.046080268220975995,0.37744061276316643,0.57114122458733618,0.24830576241947711,0.75442301342263818,0.84445408987812698,0.86037414870224893,0.34833524422720075,0.59190808585844934,0.35323318676091731,0.74105540243908763,0.97661902010440826,0.23639922449365258,0.20810725633054972,0.098775886930525303,0.17673270893283188,0.72876992146484554,0.75972377206198871,0.389333805302158,0.4298895956017077,0.87992311012931168,0.44776958017610013,0.23385278228670359,0.85340204508975148,0.78445862303487957,0.14106179890222847,0.72580009582452476,0.58781557902693748,0.44339589751325548,0.81010889285244048,0.84394630370661616,0.44699317635968328,0.3904179681558162,0.33918294310569763,0.50664030923508108,0.95791306672617793,0.66617184178903699,0.1776356112677604,0.66092152171768248,0.0033165118657052517,0.070940457284450531,0.37200408428907394,0.57705007656477392,0.46020666765980422,0.44214630336500704,0.6386767472140491,0.74851861107163131,0.0082585050258785486,0.22004144452512264,0.42504025320522487,0.68281636573374271,0.65902987960726023,0.38089418807066977,0.23681046930141747,0.41080323071219027,0.8336517121642828,0.77375198481604457,0.89762401720508933,0.67692682705819607,0.43628683453425765,0.046928776195272803,0.24976977682672441,0.86429114104248583,0.49499971885234118,0.85074564907699823,0.38901010109111667,0.32638914859853685,0.11517590470612049,0.76060856343246996,0.75625176634639502,0.46497599431313574,0.87958956067450345,0.24487716634757817,0.81561397318728268,0.18008175049908459,0.85842076665721834,0.81437454465776682,0.86026374786160886,0.68104154686443508,0.73871280159801245,0.38079221663065255,0.95183097152039409,0.050451542483642697,0.36079623107798398,0.21857434255070984,0.61548982025124133,0.46893237088806927,0.98420964763499796,0.95912430458702147,0.78394526150077581,0.83231444400735199,0.60811761650256813,0.86940102931112051,0.71477839769795537,0.12316138111054897,0.11100351857021451,0.030459611676633358,0.18818316725082695,0.92210813448764384,0.49322175676934421,0.95578338811174035,0.31901769270189106,0.45982596883550286,0.53778577875345945,0.55695225577801466,0.9168571406044066,0.57620943919755518,0.64194830320775509,0.82211426598951221,0.5114173386245966,0.48861817456781864,0.62491474603302777,0.25774179911240935,0.69047001074068248,0.0228296909481287,0.99414285412058234,0.99469852261245251,0.29224515077657998,0.74910588981583714,0.023837592219933867,0.40128396986983716,0.37894461071118712,0.69384991773404181,0.17220861697569489,0.9344348085578531,0.19300016388297081,0.82173800282180309,0.025721201673150063,0.31642458797432482,0.48708301479928195,0.88671892741695046,0.58163019083440304,0.77672801329754293,0.90190916229039431,0.044288143049925566,0.30282547976821661,0.72579146130010486,0.44699101033620536,0.83088429947383702,0.50831827498041093,0.19142571440897882,0.55249737482517958,0.56900001433677971,0.79956862051039934,0.090578283881768584,0.84781031124293804,0.81563784414902329,0.11799111985601485,0.31460910500027239,0.89309833431616426,0.43821189133450389,0.91767052770592272,0.59574359958060086,0.98857715539634228,0.96626610541716218,0.99018207844346762,0.165654965210706,0.25047772354446352,0.39069765480235219,0.54525757557712495,0.43183470284566283,0.21736325649544597,0.3127685752697289,0.26302700326777995,0.91281583486124873,0.60886886203661561,0.4075166848488152,0.18197108316235244,0.77370588365010917,0.25444926111958921,0.81623410410247743,0.529766118619591,0.82112046051770449,0.5837329316418618,0.84400854608975351,0.34666844364255667,0.15634218882769346,0.87476270389743149,0.75446125376038253,0.36895471042953432,0.36634194501675665,0.9592943605966866,0.43607058096677065,0.16160610900260508,0.88143669022247195,0.82673709327355027,0.50978434248827398,0.78625258943066001,0.87139105563983321,0.52510392339900136,0.27116622705943882,0.71433150442317128,0.24450190016068518,0.47729194397106767,0.97794366674497724,0.48992185504175723,0.53823603526689112,0.3259084967430681,0.70001978636719286,0.7208599781151861,0.29748188424855471,0.40628745476715267,0.80095255863852799,0.70671456214040518,0.78285519895143807,0.46453156601637602,0.020025216042995453,0.74512048182077706,0.09201812231913209,0.93324568099342287,0.64106068830005825,0.60250190366059542,0.16639142017811537,0.69731771340593696,0.67293265694752336,0.070771074388176203,0.54266939265653491,0.7372941910289228,0.74475560337305069,0.49928146507591009,0.97175141843035817,0.28302174806594849,0.59446411184035242,0.035720168612897396,0.90465396526269615,0.13454448245465755,0.63604598119854927,0.6488518959376961,0.062315247254446149,0.39038317231461406,0.36773828673176467,0.84001163160428405,0.77764138020575047,0.68179793399758637,0.88416077313013375,0.17541699786670506,0.39163218392059207,0.60622203606180847,0.89188903500325978,0.3355967397801578,0.55529867648147047,0.79023372102528811,0.6697341117542237,0.42176179704256356,0.79027306754142046,0.59122447832487524,0.90161892981268466,0.31257477379404008,0.76908335322514176,0.2286891748663038,0.16385106812231243,0.38285508519038558,0.1181339961476624,0.46843028860166669,0.91595032787881792,0.98030476761050522,0.17195621784776449,0.94206160539761186,0.51698930561542511,0.75566296139732003,0.41712684882804751,0.06024282961152494,0.34814287023618817,0.52367436001077294,0.12156884046271443,0.34745029709301889,0.76308499230071902,0.90110023180022836,0.67640391644090414,0.055030826479196548,0.78113711695186794,0.61619756813161075,0.76153449853882194,0.13728291052393615,0.49990228260867298,0.57506735203787684,0.27353907516226172,0.97714313329197466,0.74522598413750529,0.39974077697843313,0.9186262683942914,0.4843598750885576,0.87773349112831056,0.16271487134508789,0.22396826278418303,0.32532484992407262,0.7233949308283627,0.87747588939964771,0.48640212952159345,0.67544056987389922,0.49059884157031775,0.68935450632125139,0.89989617303945124,0.075791398994624615,0.97933710576035082,0.81086930423043668,0.23190916306339204,0.62747989385388792,0.53035813244059682,0.99750084988772869,0.83514713007025421,0.72935476084239781,0.021562033565714955,0.082533107604831457,0.60126409772783518,0.91363752074539661,0.85392284183762968,0.26751146651804447,0.032181974733248353,0.310430794255808,0.26772950380109251,0.62144373659975827,0.35547814308665693,0.29567677597515285,0.90215622331015766,0.81861313432455063,0.18008799804374576,0.4607907347381115,0.49562552524730563,0.00093275681138038635,0.38609332451596856,0.76992044923827052,0.62669218657538295,0.78028041427023709,0.71216213912703097,0.19011078868061304,0.68803620943799615,0.88637467031367123,0.77485670940950513,0.044396113837137818,0.7989401591476053,0.20470134261995554,0.96431204723194242,0.24274246976710856,0.023340889951214194,0.5040981590282172,0.088337753433734179,0.98801788548007607,0.51555647468194366,0.75501057668589056,0.96541546634398401,0.64855949627235532,0.15048732189461589,0.25812335172668099,0.8948197194840759,0.28201959142461419,0.13599890912882984,0.41273247031494975,0.16087814653292298,0.64853348326869309,0.16846815426833928,0.0042255276348441839,0.048330458346754313,0.047235918696969748,0.78457109816372395,0.064436119748279452,0.9263711862731725,0.15111327217891812,0.2203446445055306,0.24710838007740676,0.55797189148142934,0.50573340943083167,0.35543041327036917,0.80941334785893559,0.48457497032359242,0.57011404796503484,0.60014216089621186,0.84654901176691055,0.32545249233953655,0.13517080014571548,0.50857351114973426,0.27876261225901544,0.44886606209911406,0.87537585059180856,0.3791787235531956,0.21868348750285804,0.70438150479458272,0.27788673550821841,0.51126769767142832,0.050378622254356742,0.94868056103587151,0.82372018042951822,0.43439543852582574,0.68531370908021927,0.96451080613769591,0.54815580090507865,0.90792693616822362,0.73102723946794868,0.31352423201315105,0.42191251018084586,0.9831589343957603,0.97423283522948623,0.82501313532702625,0.67138016154058278,0.93698925944045186,0.44905400741845369,0.79437646269798279,0.26977523509413004,0.8728222525678575,0.27804624801501632,0.98484526807442307,0.44009364326484501,0.81002579559572041,0.75663222395814955,0.90415506460703909,0.084216617746278644,0.71189024718478322,0.68258250970393419,0.091382969170808792,0.061871020123362541,0.36110911285504699,0.14425288699567318,0.30726087652146816,0.042063910514116287,0.38153320457786322,0.42399054463021457,0.82802886283025146,0.41215704404748976,0.56318541849032044,0.94574234075844288,0.034575180849060416,0.67237047129310668,0.44896298879757524,0.23075708118267357,0.78060909267514944,0.64440282434225082,0.33310233638621867,0.63001731690019369,0.85732579324394464]}
diff --git a/lib/node_modules/@stdlib/random/base/pcg32/test/fixtures/float64_integer_seed.json b/lib/node_modules/@stdlib/random/base/pcg32/test/fixtures/float64_integer_seed.json
new file mode 100644
index 000000000000..ab5606d18bb4
--- /dev/null
+++ b/lib/node_modules/@stdlib/random/base/pcg32/test/fixtures/float64_integer_seed.json
@@ -0,0 +1 @@
+{"seed":1234,"expected":[0.61781708337366581,0.048803322482854128,0.27840037900023162,0.7566395471803844,0.017918106634169817,0.73205088777467608,0.58453386928886175,0.49513439415022731,0.49145319615490735,0.68466906785033643,0.22676102863624692,0.76340949488803744,0.09467040142044425,0.10836812458001077,0.21138599026016891,0.67876791046001017,0.56516328360885382,0.30069172801449895,0.71650695032440126,0.86924186022952199,0.11579168913885951,0.48290409613400698,0.15971443383023143,0.7899356628768146,0.85144673381000757,0.92413459438830614,0.39835617691278458,0.23140440066345036,0.62362848711200058,0.66961210314184427,0.43726725107990205,0.015567490831017494,0.63641281239688396,0.9967710196506232,0.56800644658505917,0.80708055407740176,0.60052573960274458,0.71545765805058181,0.73303170641884208,0.67932146950624883,0.29775056522339582,0.90214413544163108,0.8954621902666986,0.7726908999029547,0.68016267288476229,0.45956492749974132,0.82198655791580677,0.021909181959927082,0.24738169368356466,0.081365200690925121,0.34677769942209125,0.48994865245185792,0.52424654178321362,0.81084246747195721,0.033118538791313767,0.8115251378621906,0.69403864140622318,0.37932868092320859,0.26132260891608894,0.99667570414021611,0.29798351903446019,0.80927710607647896,0.18761440925300121,0.33219673275016248,0.51411510515026748,0.45693765138275921,0.8236919897608459,0.79485624120570719,0.58653715113177896,0.70161331375129521,0.68138413783162832,0.5357873213943094,0.41137993335723877,0.97534022433683276,0.097029590047895908,0.47092052479274571,0.25229335762560368,0.12816121336072683,0.7580700027756393,0.024283639853820205,0.87946249451488256,0.75206000031903386,0.96166942827403545,0.98239361611194909,0.98285311972722411,0.67422609939239919,0.35244033625349402,0.76225044275633991,0.17147522256709635,0.16322551132179797,0.48329648398794234,0.56882668659090996,0.74999787332490087,0.63615429471246898,0.1858246095944196,0.59107030765153468,0.42224660725332797,0.043351194821298122,0.51188649632968009,0.1090362798422575,0.81370435305871069,0.24895949498750269,0.63826430612243712,0.17240026919171214,0.52442530984990299,0.45920902420766652,0.35195034020580351,0.18312947312369943,0.058673144318163395,0.81708217551931739,0.72705729142762721,0.015281539643183351,0.50566850206814706,0.068450361723080277,0.82993072457611561,0.58606686559505761,0.11546835652552545,0.33915577712468803,0.19361724867485464,0.91971604852005839,0.52346349530853331,0.43669191701337695,0.89140185783617198,0.72975088260136545,0.49656789912842214,0.45274999551475048,0.33453847747296095,0.68071660655550659,0.74412222392857075,0.92049109772779047,0.38651667768135667,0.20467850868590176,0.2215364386793226,0.038954148069024086,0.34370927466079593,0.70771982287988067,0.10899583227001131,0.51384529937058687,0.41651650867424905,0.5366194206289947,0.41980176093056798,0.53028492419980466,0.10589165240526199,0.99369494733400643,0.70582400914281607,0.29297718871384859,0.56405008886940777,0.26858556573279202,0.93095342768356204,0.67513994709588587,0.14135265070945024,0.25043713673949242,0.49720554891973734,0.65142210642807186,0.16583849140442908,0.055868188850581646,0.96182609884999692,0.84634479880332947,0.23586088721640408,0.40714632254093885,0.25533493398688734,0.19433638965710998,0.98855602531693876,0.56146782846190035,0.032465975498780608,0.29258191143162549,0.52834798023104668,0.85893052024766803,0.67912199511192739,0.24202068825252354,0.6239616540260613,0.69999811705201864,0.21495194407179952,0.24448464531451464,0.084153239149600267,0.80400839261710644,0.68528117355890572,0.55210251035168767,0.55177579540759325,0.95783363468945026,0.72811999637633562,0.96352406986989081,0.57579885656014085,0.2353696923237294,0.82575575308874249,0.71509407740086317,0.67166599840857089,0.56351700588129461,0.42987940111197531,0.50732293305918574,0.3715525500010699,0.10207785456441343,0.67643492599017918,0.085074779810383916,0.20558580779470503,0.27714602556079626,0.20070424769073725,0.35134732956066728,0.83591321622952819,0.87726062978617847,0.94717808067798615,0.42392268404364586,0.30516919703222811,0.3315955672878772,0.95057219010777771,0.83319067605771124,0.77408045972697437,0.03979398705996573,0.98131178226321936,0.9464372037909925,0.92645586235448718,0.13665814814157784,0.3537602077703923,0.77455215877853334,0.59022724442183971,0.94704327173531055,0.023832325590774417,0.14539674040861428,0.7947620740160346,0.6782907925080508,0.39700128533877432,0.0014909238088876009,0.54227403434924781,0.44733924977481365,0.4438057926017791,0.035304751945659518,0.70861140289343894,0.64496648660860956,0.40122018754482269,0.87839839654043317,0.32343925489112735,0.39888175413943827,0.89684300008229911,0.79773347242735326,0.89546421263366938,0.55957512417808175,0.54934809054248035,0.24711828213185072,0.048678090097382665,0.96544562396593392,0.51416305522434413,0.73626613733358681,0.24522282229736447,0.21915204543620348,0.62716543069109321,0.22530345292761922,0.36152884713374078,0.67063096002675593,0.84586367080919445,0.6405410161241889,0.87816519313491881,0.9437570373993367,0.36943221255205572,0.38017005822621286,0.55601154733449221,0.044244814896956086,0.90363410115242004,0.15595812140963972,0.82983229146338999,0.31518900557421148,0.26566163264214993,0.26446049241349101,0.55244039837270975,0.63092056638561189,0.8453253956977278,0.91544035542756319,0.23944720602594316,0.52039802889339626,0.41473140683956444,0.89056012453511357,0.17337051848880947,0.19186921766959131,0.90815408411435783,0.70770006207749248,0.1016483346465975,0.45759342261590064,0.50804604729637504,0.96469033625908196,0.90869686217047274,0.50329220481216908,0.39033390651457012,0.28820118959993124,0.26373196952044964,0.83893679385073483,0.068318092729896307,0.042116998229175806,0.24180936673656106,0.64139680424705148,0.088935293955728412,0.98992095026187599,0.25992352399043739,0.71866114903241396,0.78101805387996137,0.52737178886309266,0.23632707446813583,0.58166917902417481,0.022468467708677053,0.28407397144474089,0.5547626216430217,0.67745316354557872,0.84048152901232243,0.50784559617750347,0.11537669156678021,0.28139735222794116,0.97087435866706073,0.74158852430991828,0.99063570587895811,0.38449687976390123,0.008948066970333457,0.74201310309581459,0.22234661690890789,0.29554072860628366,0.47209848486818373,0.13898651022464037,0.014850100735202432,0.88137941737659276,0.87240655859932303,0.63702315255068243,0.78993255901150405,0.24725115182809532,0.59973526163958013,0.75040149828419089,0.97908247681334615,0.76816442492417991,0.83555777766741812,0.12368707871064544,0.11821478884667158,0.24124146089889109,0.41289916657842696,0.36556406784802675,0.77440680237486959,0.94876864412799478,0.010637497762218118,0.82675644941627979,0.17913654586300254,0.5808933530934155,0.67777717835269868,0.97975121927447617,0.21526167541742325,0.77901304396800697,0.028698082780465484,0.18612959701567888,0.58986545563675463,0.86262782313860953,0.58290868462063372,0.91307180607691407,0.90449904999695718,0.052300567273050547,0.2213198586832732,0.62968999287113547,0.27852732152678072,0.97734039346687496,0.86478725378401577,0.65469799353741109,0.32821648335084319,0.76344550494104624,0.93032292812131345,0.58641208917833865,0.49198942165821791,0.71451989491470158,0.60620355349965394,0.46411776612512767,0.35103494324721396,0.97503654798492789,0.67731661722064018,0.3969067819416523,0.54956425074487925,0.22468815185129642,0.22727044229395688,0.78255002503283322,0.6875915490090847,0.041915276320651174,0.55705071799457073,0.088259609881788492,0.59336990583688021,0.8839827396441251,0.29668283835053444,0.053700658492743969,0.66958985151723027,0.022734179394319654,0.86990883224643767,0.27823940152302384,0.20229082345031202,0.48073587752878666,0.38860893086530268,0.12875630497001112,0.04697462054900825,0.21776470798067749,0.53806264000013471,0.42733804089948535,0.1913273842073977,0.21373369917273521,0.86653056344948709,0.10565762827172875,0.034349317196756601,0.053673251299187541,0.933798918267712,0.28456415934488177,0.25137984589673579,0.17795043485239148,0.88001135620288551,0.68967300257645547,0.09595725079998374,0.69828289677388966,0.056899902177974582,0.29836599878035486,0.48090757802128792,0.20682965777814388,0.75471295183524489,0.26780552393756807,0.15465177549049258,0.84817813825793564,0.0030132664833217859,0.21270791604183614,0.51961126853711903,0.96362675935961306,0.6698626521974802,0.22886208677664399,0.095042087370529771,0.36935170041397214,0.95825287536717951,0.35341092385351658,0.18418892566114664,0.59321448393166065,0.84583296510390937,0.5463794160168618,0.87928806571289897,0.9177662474103272,0.24332092376425862,0.26575879007577896,0.42822854453697801,0.81124144187197089,0.91146013583056629,0.073099353117868304,0.68319239164702594,0.78224516496993601,0.21665065712295473,0.32017389917746186,0.26020315336063504,0.85018303012475371,0.57440647762268782,0.54776986874639988,0.40828404622152448,0.93878896860405803,0.55278361425735056,0.77452748618088663,0.6921283071860671,0.64938964927569032,0.49000280117616057,0.075917633483186364,0.30307992501184344,0.60572739085182548,0.3754165677819401,0.64465056243352592,0.3854447731282562,0.99259150796569884,0.53100319602526724,0.20848974213004112,0.030266521964222193,0.82309693191200495,0.35353697161190212,0.12129121576435864,0.012373458128422499,0.088928291108459234,0.39447693293914199,0.31266636634245515,0.61307765846140683,0.31677236873656511,0.67779750027693808,0.65662650228478014,0.70141439093276858,0.57058902899734676,0.53037720988504589,0.022837185999378562,0.01643519545905292,0.63016730430535972,0.39528934378176928,0.0055368347093462944,0.43883223016746342,0.12243739375844598,0.87237232574261725,0.64078399818390608,0.9909334727562964,0.91891134576871991,0.64812358096241951,0.66532672173343599,0.5777307206299156,0.15570165449753404,0.056778701255097985,0.8256426858715713,0.10936872125603259,0.097459845012053847,0.64733180915936828,0.37389653106220067,0.21528601506724954,0.40666553587652743,0.95129942893981934,0.75127434427849948,0.11945408722385764,0.96530506014823914,0.48655353812500834,0.061782636679708958,0.88040473032742739,0.55179183906875551,0.11650059814564884,0.68539075972512364,0.71931476844474673,0.21761706611141562,0.1222942266613245,0.099109011236578226,0.88484321907162666,0.68109587230719626,0.70110989012755454,0.19699592236429453,0.65706957061775029,0.75212912447750568,0.77922554942779243,0.20200694212689996,0.27790820645168424,0.039773417636752129,0.80997179006226361,0.29343576123937964,0.65469086030498147,0.15084818052127957,0.74206292093731463,0.33820070140063763,0.79405471892096102,0.25162832718342543,0.14629940176382661,0.27184760407544672,0.14917261153459549,0.52838234230875969,0.64989451551809907,0.034195217769593,0.980471984250471,0.97586853569373488,0.86328774690628052,0.58512017293833196,0.90889540431089699,0.34789505577646196,0.52850530203431845,0.32774433703161776,0.67488284804858267,0.13340220018289983,0.69701736327260733,0.5747382240369916,0.58051307452842593,0.85006237775087357,0.06374392518773675,0.14811116084456444,0.56768370093777776,0.35373925277963281,0.82871898496523499,0.072469142964109778,0.26715481467545033,0.30296843638643622,0.015037370612844825,0.13910923083312809,0.64789747493341565,0.10544163687154651,0.20280852937139571,0.84529435075819492,0.71701918286271393,0.057089944137260318,0.59676255076192319,0.73992652632296085,0.80631082621403039,0.29937094473280013,0.9008284208830446,0.16142000933177769,0.03151834849268198,0.54343520104885101,0.35335342097096145,0.027394684264436364,0.80177906109020114,0.10034990264102817,0.67987308092415333,0.6056916294619441,0.61868971050716937,0.18775597610510886,0.53125019767321646,0.36048312881030142,0.85841297102160752,0.10529050440527499,0.41708220378495753,0.11774706048890948,0.40530271385796368,0.75040131341665983,0.90849425876513124,0.64955550292506814,0.83287963108159602,0.11558121209964156,0.13102823193185031,0.30694811209104955,0.044585339026525617,0.074123027035966516,0.145424545975402,0.42923259292729199,0.73423408041708171,0.89089375338517129,0.93832696927711368,0.78259566426277161,0.61120784864760935,0.66361449006944895,0.27228914364241064,0.77059142827056348,0.12777330167591572,0.6248885914683342,0.86346695013344288,0.53713854006491601,0.80509347980841994,0.16000295639969409,0.32233810471370816,0.12931780843064189,0.92184730782173574,0.089918100973591208,0.366991369985044,0.86021015862934291,0.38561326172202826,0.68598286574706435,0.30995186837390065,0.70633023837581277,0.95253550773486495,0.90924640744924545,0.54993149405345321,0.0067116266582161188,0.81708950409665704,0.091706508537754416,0.285572828957811,0.88088913052342832,0.87281172722578049,0.5279169196728617,0.29794183513149619,0.1968927311245352,0.86510796169750392,0.96489947219379246,0.27380059123970568,0.5745071591809392,0.32544713281095028,0.29011198529042304,0.98189895157702267,0.43907223525457084,0.80078741000033915,0.68804799928329885,0.90171551331877708,0.068445359822362661,0.88942734431475401,0.37447717715986073,0.08687077066861093,0.41540224757045507,0.7520661661401391,0.43299792776815593,0.97466497565619648,0.049104706151410937,0.99654268845915794,0.37331785075366497,0.97757704113610089,0.38088881713338196,0.8226391754578799,0.55740561219863594,0.97016968135721982,0.28562378650531173,0.80698159732855856,0.091014739824458957,0.30969412322156131,0.57758305943571031,0.24003689736127853,0.82552770897746086,0.74527207086794078,0.61895166710019112,0.90896357549354434,0.99348029517568648,0.55337806767784059,0.49877947103232145,0.93394411448389292,0.81577970972284675,0.44154004869051278,0.40058604278601706,0.53256015316583216,0.41524123167619109,0.79522844031453133,0.21056404756382108,0.43082593218423426,0.35247359704226255,0.77294979034923017,0.30161005258560181,0.20718024810776114,0.45165774505585432,0.73487072438001633,0.96532238251529634,0.12001513014547527,0.18747242260724306,0.53541963128373027,0.44149517081677914,0.29598974087275565,0.28946453891694546,0.49858617596328259,0.20989579893648624,0.27663970063440502,0.4449436163995415,0.46391032356768847,0.075077459448948503,0.80286489240825176,0.83866080269217491,0.9218766875565052,0.41497189761139452,0.40920240036211908,0.29583857115358114,0.55894182994961739,0.62749092164449394,0.3138576780911535,0.99217922333627939,0.44101290195249021,0.32917725620791316,0.035994452657178044,0.44585487386211753,0.81525416090153158,0.45563956839032471,0.67505659768357873,0.16763496538624167,0.28526839846745133,0.64290204155258834,0.84857242624275386,0.54127945750951767,0.011199799599125981,0.58901088708080351,0.51336100720800459,0.40459486981853843,0.72775098378770053,0.23717890889383852,0.084764545317739248,0.13709356146864593,0.17076657665893435,0.015000402694568038,0.25581205682829022,0.87404455174691975,0.076949449721723795,0.14918389543890953,0.93794274074025452,0.61707761883735657,0.38605459732934833,0.75656139478087425,0.38357605063356459,0.684791951905936,0.92074098042212427,0.97607624484226108,0.85964034614153206,0.90284073865041137,0.119433653075248,0.23568661115132272,0.23020284110680223,0.42085902253165841,0.42134972056373954,0.90575287444517016,0.36571411462500691,0.95452540856786072,0.30174755211919546,0.004814694169908762,0.10178858693689108,0.55961118103004992,0.8280229780357331,0.91924490174278617,0.47186975460499525,0.33872216078452766,0.31493210047483444,0.76257304032333195,0.8090795932803303,0.79071109765209258,0.019810439087450504,0.22487463196739554,0.094997815089300275,0.060800035949796438,0.67835552175529301,0.315174795454368,0.33396800002083182,0.88054628996178508,0.66225976007990539,0.95850462350063026,0.77721839002333581,0.27197752194479108,0.60984320496208966,0.44416925054974854,0.36222852021455765,0.28891969379037619,0.40868473425507545,0.61110180919058621,0.59265667223371565,0.18720287154428661,0.92023563897237182,0.97887403471395373,0.10799721628427505,0.42825805954635143,0.78315231739543378,0.31547112157568336,0.52342132548801601,0.24021335411816835,0.68942171265371144,0.24114426993764937,0.86939530912786722,0.084708732552826405,0.70727959484793246,0.85285310680046678,0.4396490273065865,0.074158395873382688,0.26246210839599371,0.17727740108966827,0.14239507215097547,0.34724765364080667,0.99256322672590613,0.71373212593607605,0.84798222896642983,0.64354922994971275,0.51662093633785844,0.95517992856912315,0.20026450091972947,0.8824699881952256,0.91247416706755757,0.33998720836825669,0.28718028077855706,0.076026596827432513,0.20941283996216953,0.22528544114902616,0.21332815894857049,0.19462952669709921,0.91840033722110093,0.8330836771056056,0.28543457062914968,0.82050653710030019,0.12291048187762499,0.088035071501508355,0.87193197244778275,0.12094323919154704,0.19004245055839419,0.88213377213105559,0.25340761733241379,0.93393524526618421,0.41344363708049059,0.74981875019147992,0.71786442771553993,0.379330302355811,0.020761721301823854,0.75324940914288163,0.46938955900259316,0.6210503545589745,0.054035525070503354,0.086905991658568382,0.91699561849236488,0.13505410496145487,0.27607492031529546,0.29810636839829385,0.42081101122312248,0.096079249633476138,0.70072402548976243,0.6680105107370764,0.40374123235233128,0.13969232281669974,0.96816346049308777,0.19222266506403685,0.64967758511193097,0.41318334918469191,0.11306642950512469,0.82136696251109242,0.71222368627786636,0.64804761647246778,0.37789750215597451,0.9665385705884546,0.20588537817820907,0.27189836883917451,0.61631935671903193,0.29433127050288022,0.49566096439957619,0.26901954622007906,0.014748417772352695,0.48368261498399079,0.89113610750064254,0.66363689652644098,0.10045141307637095,0.017637324286624789,0.091517998138442636,0.13106645946390927,0.37318220408633351,0.13293993612751365,0.63180771889165044,0.9707275340333581,0.69629813032224774,0.79038343764841557,0.96711182477883995,0.33918249513953924,0.70478468202054501,0.63983168127015233,0.55161452293395996,0.76675131684169173,0.22320471727289259,0.35626181401312351,0.019524212926626205,0.91592790745198727,0.070454535074532032,0.074053279124200344,0.029606548137962818,0.40352855669334531,0.36233117943629622,0.79299549222923815,0.16854288103058934,0.54810456582345068,0.94108438841067255,0.42218086193315685,0.53763387515209615,0.67638081521727145,0.33907380630262196,0.61720150127075613,0.42224397393874824,0.088212313363328576,0.10599083709530532,0.31996645242907107,0.050363254500553012,0.95680650975555182,0.89661016059108078,0.85096519603393972,0.18936076620593667,0.72490837634541094,0.43717475282028317,0.97657664841972291,0.089531907346099615,0.85529106622561812,0.56942759547382593,0.73439231538213789,0.21528194402344525,0.99570055678486824,0.4997948503587395,0.83800096530467272,0.29118222859688103,0.53178106900304556,0.13288716622628272,0.68602032191120088,0.71715355943888426,0.21824003336951137,0.69718028698116541,0.015244042035192251,0.1195538139436394,0.62857791385613382,0.01931343087926507,0.34712963947094977,0.34861533739604056,0.25816452503204346,0.31340599432587624,0.74877364211715758,0.431369892321527,0.76306315092369914,0.042637368896976113,0.10463983961381018,0.19458824791945517,0.4873818124178797,0.73847744800150394,0.068161012372002006,0.068462921306490898,0.19141858466900885,0.34988623741082847,0.45976480329409242,0.42710960260592401,0.45434153266251087,0.18026946950703859,0.80395515356212854,0.26716810581274331,0.02681864588521421,0.42384920013137162,0.92807172890752554,0.75376338441856205,0.13391683110967278,0.5900069703347981,0.79230379522778094,0.24671285622753203,0.23091092938557267,0.77164597786031663,0.076093607814982533,0.71406831312924623,0.88283273461274803,0.80047085392288864,0.34826551051810384,0.51438624248839915,0.012477964395657182,0.89934031572192907,0.30450603784993291,0.50137776648625731,0.93716258369386196,0.37620399077422917,0.49569581332616508,0.16038777399808168,0.27885499829426408,0.65254143811762333,0.11251378362067044,0.34884419431909919,0.05096934549510479,0.32902042125351727,0.18716852506622672,0.74788542231544852,0.85753403138369322,0.64096037298440933,0.034016719786450267,0.36478292709216475,0.45558166899718344]}
diff --git a/lib/node_modules/@stdlib/random/base/pcg32/test/fixtures/uint32_array_seed.json b/lib/node_modules/@stdlib/random/base/pcg32/test/fixtures/uint32_array_seed.json
new file mode 100644
index 000000000000..b77e4eccf9a8
--- /dev/null
+++ b/lib/node_modules/@stdlib/random/base/pcg32/test/fixtures/uint32_array_seed.json
@@ -0,0 +1 @@
+{"seed":[291,564,837,1110],"expected":[3104146194,738007708,3065431165,3184628074,135654988,1833383554,1920840725,1053460789,3286691277,3146023096,757346646,2238647498,3611344149,3242637263,316778235,3532848639,613748779,3755023225,1853275601,2780610399,1297878294,390928528,1597659398,1878820207,1260124830,2682185658,2779234724,91571077,4269805835,1208576440,964360417,851878788,3655749385,2451548111,213327612,4168428924,3680613521,2187028110,4086763928,52140497,2376567101,2951585760,1822735931,3181975275,644387376,2207465552,1927581169,1528086543,1426309583,2650284125,3713277215,1597942886,3494681731,524626927,603365229,2905658305,439313692,1410085742,47659938,2430232184,3924802305,602889876,2825642390,1855429115,1672180540,2950588165,2236848443,955428550,1208388429,3645894810,2736045195,742521229,1215272345,2937896761,196711364,2802595416,966112043,619460251,2532709900,3821423263,1392341474,3251359924,429649858,3502323865,4294776223,4018395345,2879526205,1975276867,4091133505,3915239225,3535387731,3517383949,4157740514,2121318122,496645028,2217621006,2499073371,2713869083,2230138196,328652453,58914689,3516868037,3170502978,891798262,3373690810,1930064881,341761119,452143393,1967781689,3473514626,1383682301,1264857508,4020138016,2510397040,2150365017,2840021170,2747388056,3496611299,2202238196,1311763043,1353436109,2161369770,1356128311,4158976386,1411957772,1447002616,2197904007,414164727,3506553705,1082192244,1867243491,2849909078,3523474261,793156206,1673290545,2546183736,1692539303,1976775604,2609601535,4257321991,4169496736,1531287419,4263989242,2438455411,3917031387,599929365,2812260638,3115895318,48160771,675589007,54839913,4133619452,3356182337,3169650212,2734484746,4194302574,4120739639,2741221546,2017122956,27409840,4027031581,1445838383,4282689008,893009303,1612692182,4216882136,3852092091,223320891,1367041784,4201487068,3206504930,1708395322,795360035,2207094675,2279621132,1102751729,2285383199,714308461,1273074550,4236425704,3625342280,3674720496,3020725432,1742861561,2423428739,2015763295,1536242488,2823471476,201032255,1287888660,1490226645,1418435493,1125451240,2882791093,3396500485,3762418637,4010082889,1894795879,2902158938,2604524825,1746792595,2617702262,1859490534,3302633546,2589211870,1394722391,2524147947,2147283973,2613289961,2616162204,829018225,2875995482,3931903582,2525286632,806387657,2730852577,3296584371,1285927965,1511172892,1268558974,432128337,2767067556,1047344647,2159341021,4198557285,971682399,2840022347,707548806,3843509582,336390286,2573419415,2907883687,2639328041,2658603992,1872174690,3250997270,3668082577,262071452,3476743425,3243809640,1300287945,1961385409,3138896745,2747312540,2422646310,3792150396,2134373581,1152575264,717381310,3760637181,2472548057,2825818228,3101307771,2582203355,2257824027,2321151134,3504321215,3753673885,3494221712,4021426416,2788675396,1064653772,2958910166,793003476,1634830655,4034196507,406347183,356309878,1527930019,3889011267,839832393,3635252065,209561021,913525616,739645589,4167194413,4113454787,186459562,502350719,3803972960,4108945345,2523210329,2627935826,232344602,2047327672,1572883165,1390910781,3007961214,1789811914,1287156872,284243468,4031169400,3666788612,1573062533,2646536471,391832026,2371261301,426928111,970505598,3114014169,3955393795,2624274517,2565711249,1851861872,1423607843,1699246808,1910723691,1079340885,1278466519,2174865957,3956597804,712934678,704891904,2955494861,4059818870,2096095831,3808820827,3129773409,1078485727,2264718062,1423157922,1303050402,3340491136,1581175532,3765297722,3958212124,4212694973,1644762725,1254056514,2111526909,4070068690,4293849003,1147830328,3237812769,2594145161,1018644814,2029252204,2792255501,1867081954,918814289,935878411,61103941,84027726,4097028432,1822855205,88105690,814090829,157147821,1660768452,2202865307,4192602274,4147418208,4225234616,2114217501,2788970401,829440055,2713314676,212866598,3453502256,2913791110,374574747,388809155,268854878,554432627,2895536870,3624911819,2230940519,1442511228,3073945482,2405802984,145024254,1842581501,949114966,2008300274,1694656362,4282979816,896272428,3807107762,3700600822,3628369448,2955641492,1432906635,4203906382,3868513053,38545664,1298456003,2317958452,1259857582,3848466956,3319523675,377371706,3155392474,904694775,3176877881,3676835348,2121124849,1648341316,3394415404,437450892,4120303586,1891437730,4157088175,3910586635,4145884903,3750826794,1685793864,1385146463,3825648778,182371828,443613657,926195628,3529309362,1496646740,4270231886,3416796868,2352019922,28831514,1970971294,1147004439,3482379584,2596713180,3632773590,208648965,2805366717,146784459,1214378384,3849812886,2174049347,2385262222,616501503,553878317,2705364490,2672854862,941823531,3363844416,3711824484,822329062,2386046897,3003950717,3809600512,2749716939,558117344,951507392,2424702803,2546742505,1676174327,856683738,3760087799,5519689,2413053285,1530005731,1666010503,2408851809,1468304775,2212585405,3432394359,2225189752,782872915,1245985579,1749339043,846391685,309444203,108491679,3723103104,3357962791,3232671846,1071300076,3659315060,2864939478,2958768421,2939188902,538681704,942113268,679262372,1938173131,3870316988,3575132661,2773525586,53554396,3085871718,4009012989,1928160565,252839724,3300278954,1303429792,1311050331,513324227,2329010780,125889215,1398321178,927403611,3295831143,2719966901,406064242,2607067005,2293571317,1094357722,2242903128,935028543,4171217173,1274882979,2021229751,2945085020,3614989217,2093012687,287145023,2450610942,3102272315,3077011317,2181797668,2217794099,415367223,825080029,2953680878,3099521316,4278243887,125492751,2582182914,555918069,3430386096,1270444368,3701069930,547864071,2146793688,1349804245,4252886595,4123751439,1031599932,1306589498,1900600053,1342538133,573045523,3780386685,1437949867,448546136,2569916941,2305228780,3201807449,562115445,112385752,268284137,27821450,2808048850,355836140,3778924528,2594127177,910340932,3990517288,1941975980,1741322322,3164779180,531066082,4202090059,2513633410,4052701964,3361183906,735580304,3384752895,2887244514,857864645,1275324100,3905401789,2460239541,419310017,3280081180,3302858,614564600,2112146825,406842597,1067090552,3401204218,197913245,1621095088,2453032881,1066465129,3240222170,3626902699,3695278831,1496088482,2542225871,1517124985,3182808718,4194546752,1015326938,893813860,424239204,759061205,3130042979,3262988755,1672175961,1846361754,3779240981,1923155703,1004390052,3665333874,3369224131,605855813,3117287675,2524648688,1904370879,3479391201,3624721774,1919821074,1676832405,1456779648,2176003559,4114205294,2861186274,762939141,2838636321,14244310,304686944,1597745376,2478411207,1976572587,1899003913,2743095742,3214862955,35470009,945070808,1825533987,2932673960,2830511780,1635928081,1017093221,1764386441,3580506840,3323239470,3855265798,2907378584,1873837686,201557559,1072753023,3712102185,2126007604,3653924740,1670785662,1401830719,494676744,3266788905,3248076604,1997056689,3777808397,1051739421,3503035341,773445229,3686889119,3497712036,3694804663,2925051171,3172747324,1635490117,4088082894,216687725,1549608013,938769653,2643508649,2014049197,4227148249,4119407521,3367019260,3574763317,2611845275,3734048988,3069949842,528974104,476756482,130823036,808240549,3960424281,2118371315,4105058394,1370170557,1974937498,2309772332,2392091724,3937871434,2474800697,2757146968,3530953886,2196520744,2098599080,2683988397,1106992598,2965546115,98052776,4269811046,4272197624,1255183365,3217385298,102381679,1723501527,1627554710,2980062705,739630378,4013366943,828929392,3529337848,110471720,1359033257,2092005619,3808428794,2498082648,3336021415,3873670356,190216126,1300625532,3117250590,1919811771,3568620893,2183210367,822167183,2372958156,2443836453,3434121076,389030767,3641317560,3503137866,506768001,1351235817,3835828138,1882105742,3941364905,2558699277,4245906552,4150081322,4252799644,711482658,1075793631,1678033650,2341863455,1854715926,933568078,1343330802,1129692377,3920514158,2615071850,1750270834,781559851,3323041467,1092851255,3505698783,2275328154,3526685524,2507113851,3624989103,1488929628,671484588,3757077205,3240386411,1584648415,1573426673,4120137906,1872908884,694092953,3785741758,3550808778,2189507079,3376929158,3742596086,2255304178,1164650077,3068030450,1050127665,2049953290,4200236066,2104198345,2311706169,1399766335,3006562089,3096070031,1277674964,1744991331,3440065045,3035315932,3362337477,1995147884,86007648,3200268101,395214826,4008259679,2753334691,2587725972,714645708,2994956774,2890223754,303959450,2330747294,3166654438,3198700960,2144397564,4173640562,1215569152,2553203919,153416956,3885459195,577864152,2731796688,2786797673,267641949,1676682958,1579423915,3607822486,3339944296,2928299829,3797441605,753410269,1682047422,2603703819,3830634237,1441377022,2384989655,3394027988,2876486107,1811453125,3394196980,2539289799,3872423817,1342498431,3303187850,982212527,703734979,1644350070,507381650,2011892770,3933976703,4210376917,738546332,4046123786,2220452160,3245547706,1791546174,258740983,1495262242,2249164250,522134194,1492287663,3277425086,3870196026,2905132700,236355600,3354958371,2646548403,3270765766,589625611,2147063955,2469895470,1174841382,4196797801,3200721230,1716873564,3945469780,2080309823,3769836639,698855051,961936364,1397259591,3106957570,3768730248,2089081239,2900995158,2107105980,2960755060,3865024633,325521580,4206220841,3482657143,996042271,2695005623,2277870834,4284233528,3586929611,3132554845,92608229,354476998,2582409636,3924043272,3667570679,1148953000,138220529,1333290109,1149889463,2669080525,1526766999,1269922083,3874731475,3515916640,773472062,1979081136,2128695422,4006160,1658258202,3306783150,2691622446,3351278861,3058713097,816519620,2955093018,3806950221,3327984226,190679857,3431421855,879185572,4141688706,1042570969,100248359,2165085107,379407762,4243504506,2214298198,3242745735,4146427855,2785541826,646338126,1108631354,3843221431,1211264922,584110867,1772672462,690966378,2785430101,723565213,18148503,207577738,202876726,3369707208,276751027,3978733949,649026562,946373042,1061322411,2396471026,2172108454,1526562001,3476403858,2081233650,2448621191,2577590954,3635900320,1397807811,580554166,2184306598,1197276303,1927865057,3759710650,1628560217,939238427,3025295527,1193514441,2195878041,216374535,4074551984,3537851236,1865714202,2943399968,4142542369,2354311238,3899516498,3139738086,1346576323,1812100433,4222635470,4184298166,3543404435,2883555837,4024338226,1928672276,3411820928,1158675812,3748743030,1194199542,4229878218,1890187805,3479034301,3249710657,3883316433,361707619,3057545330,2931669556,392486864,265734008,1550951830,619561432,1319675416,180663120,1638672636,1821025523,3556356886,1770201025,2418862954,4061932424,148499271,2887809185,1928281354,991094117,3352690524,2767689056,1430663641,2705903772,3682186244]}
diff --git a/lib/node_modules/@stdlib/random/base/pcg32/test/fixtures/uint32_integer_seed.json b/lib/node_modules/@stdlib/random/base/pcg32/test/fixtures/uint32_integer_seed.json
new file mode 100644
index 000000000000..9ccae20adc34
--- /dev/null
+++ b/lib/node_modules/@stdlib/random/base/pcg32/test/fixtures/uint32_integer_seed.json
@@ -0,0 +1 @@
+{"seed":1234,"expected":[2653504168,209608674,1195720523,3249742110,76957682,3144134622,2510553852,2126586030,2110775405,2940631255,973931202,3278818814,406606278,465437551,907895915,2915285977,2427357820,1291461138,3077373919,3733365362,497321518,2074057300,685968270,3392747838,3656935876,3969127860,1710926752,993874333,2678463957,2875962084,1878048543,66861864,2733372216,4281098931,2439569112,3466384585,2579238412,3072867243,3148347206,2917663495,1278828940,3874679558,3845980822,3318682145,2921276436,1973816334,3530405384,94099220,1062496284,349460876,1489398878,2104313439,2251621752,3482541880,142243041,3485473927,2980873267,1629204279,1122372059,4280689554,1279829469,3475818704,805797752,1426774103,2208107563,1962532269,3537730158,3413881561,2519157882,3013406237,2926522588,2301189023,1766863360,4189054366,416738916,2022588253,1083591720,550448220,3255885870,104297439,3777262652,3230073106,4130338744,4219348453,4221322006,2895779047,1513719718,3273840723,736480473,701048233,2075742593,2443092016,3221216338,2732261891,798110621,2538627641,1813535369,186191964,2198535761,468307256,3494833585,1069272889,2741324321,740453518,2252389555,1972287741,1511615201,786535098,251999236,3509341222,3122687289,65633713,2171829679,293992065,3564525320,2517138021,495932815,1456662971,831579751,3950150350,2248258593,1875577502,3828541827,3134256175,2132742887,1944546424,1436831820,2923655563,3195980616,3953479161,1660076490,879087501,951491759,167306792,1476220094,3039633494,468133535,2206948756,1788924783,2304762862,1803034834,2277556407,454801184,4267887301,3031491036,1258327444,2422576685,1153566221,3998414526,2899703993,607105012,1075619312,2135481572,2797836643,712270897,239952044,4131011639,3635023232,1013014797,1748680140,1096655191,834668438,4245815799,2411485961,139440303,1256629741,2269237296,3689078494,2916806759,1039470941,2679894898,3006469020,923211570,1050053556,361435410,3453189752,2943260229,2371262226,2369858996,4113864136,3127251572,4138304369,2473037258,1010905131,3546593954,3071305676,2884783497,2420287111,1846317969,2178935406,1595806051,438421047,2905265885,365393397,882984321,1190333116,862018180,1509025290,3590219926,3767805715,4068098880,1820734064,1310691721,1424192117,4082676469,3578526705,3324650259,170913873,4214702012,4064916838,3979097630,586942277,1519388523,3326676191,2535006712,4067519880,102359059,624474245,3413477116,2913236771,1705107537,6403469,2329049243,1921307448,1906131365,151632755,3043462801,2770109967,1723227584,3772692386,1389161022,1713184089,3851911355,3426239175,3845989508,2403356858,2359432083,1061364940,209070805,4146557381,2208313507,3162238981,1053224002,941250868,2693655014,967670962,1552754575,2880338041,3632956803,2751102716,3771690785,4053405611,1586699271,1632817967,2388051412,190030033,3881078912,669835031,3564102553,1353726471,1141008024,1135849166,2372713444,2709783199,3630644929,3931786388,1028417919,2235092515,1781257829,3824926610,744620707,824072015,3900492091,3039548622,436576273,1965348785,2182041158,4143313445,3902823305,2161623560,1676471363,1237814684,1132720184,3603206093,293423974,180891130,1038563322,2754778298,381974179,4251678107,1116363035,3086626132,3354446999,2265044586,1015017056,2498250101,96501334,1220088417,2382687317,2909639182,3609840680,2181180227,495539117,1208592425,4169873619,3185098459,4254747959,1651401524,38431655,3186922011,954971448,1269337764,2027647553,596942516,63780697,3785495773,3746957638,2735993607,3392734507,1061935611,2575843335,3222949894,4205127218,3299241083,3588693329,531231958,507728652,1036124185,1773388417,1570085716,3326051890,4074930298,45687705,3550891912,769385606,2494917954,2911030815,4207999445,924541856,3345835547,123257327,799420532,2533452841,3704958289,2503573737,3921613546,3884793839,224629226,950561555,2704497926,1196265737,4197645027,3714232973,2811906471,1409679062,3278973476,3995706551,2518620745,2113078476,3068839581,2603624437,1993370627,1507683601,4187750086,2909052720,1704701648,2360360484,965028264,976119117,3361026765,2953183216,180024741,2392514616,379072138,2548504340,3796676957,1274243088,230642572,2875866514,97642557,3736229985,1195029130,868832471,2064744872,1669062649,553004119,201754459,935292299,2310961442,1835402910,821744858,917979248,3721720431,453796058,147529194,230524859,4010635815,1222193758,1079668217,764291298,3779619995,2962122991,412133254,2999102205,244383219,1281472207,2065482320,888326616,3241467446,1150215967,664224318,3642897365,12941881,913573543,2231713405,4138745417,2877038184,982955178,408202657,1586353474,4115664761,1517888360,791085412,2547836808,3632824923,2346681723,3776513486,3941776018,1045055410,1141425312,1839227594,3484255462,3914691475,313959331,2934288979,3359717401,930507487,1375136426,1117564034,3651508310,2467057036,2352653672,1753566626,4032067918,2374187545,3326570223,2972668444,2789107306,2104546006,326063753,1301718366,2601579334,1612401881,2768753083,1655472695,4263148065,2280641361,895456624,129993722,3535174404,1518429731,520941805,53143598,381944102,1694265526,1342891818,2633148493,1360526964,2911118097,2820189353,3012551870,2450661219,2277952771,98084967,70588627,2706547963,1697754804,23780524,1884770077,525864602,3746810609,2752146316,4256026858,3946694178,2783669584,2857556511,2481334551,668733514,243862665,3546108334,469735081,418586847,2780268950,1605873373,924646394,1746615177,4085799936,3226698739,513051398,4145953664,2089731534,265354404,3781309524,2369927903,500366259,2943730898,3089433406,934658182,525249704,425669962,3800372688,2925284497,3011244049,846091044,2822092317,3230369992,3346748251,867613210,1193606658,170825528,3478802349,1260296998,2811875834,647888002,3187135977,1452560952,3410439049,1080735436,628351146,1167576569,640691488,2269384880,2791275690,146867342,4211095107,4191323446,3707792640,2513072007,3903676037,1494197887,2269912988,1407651209,2898599761,572958087,2993666780,2468481876,2493284670,3650990112,273778074,636132592,2438182930,1519298522,3559320938,311252599,1147421192,1301239526,64585015,597469597,2782698466,452868382,871056001,3630511592,3079573941,245199443,2563075639,3177960232,3463078629,1285788417,3869028607,693293661,135370276,2334036416,1517641387,117659273,3443614846,430999550,2920032648,2601425740,2657252073,806405777,2281702225,1548263249,3686855637,452219273,1791354425,505719774,1740761901,3222949100,3901953130,2789819642,3577190777,496417526,562761971,1318332103,191492573,318355977,624593669,1843539949,3153511363,3826359535,4030083646,3361222784,2625117721,2850202532,1169472967,3309664983,548782152,2683876064,3708562312,2306992463,3457850166,687207465,1384431618,555415758,3959304039,386195303,1576215932,3694574499,1656196348,2946273974,1331233138,3033665274,4091108854,3905183584,2361937782,28826217,3509372698,393876455,1226525961,3783390007,3748697824,2267385905,1279650438,845647841,3715610403,4144211677,1175964585,2467489460,1397784792,1246021489,4217223885,1885800891,3439355737,2955143655,3872838640,293970582,3820061356,1608367229,373107119,1784139068,3230099588,1859711939,4186154195,210903107,4280118256,1603387960,4198661421,1635905013,3533208355,2394038875,4166847053,1226744822,3465959569,390905331,1330126131,2480700351,1030950624,3545614512,3200919171,2658377168,3903968830,4266965377,2376740703,2142241516,4011259428,3503747174,1896400069,1720503953,2287328441,1783447510,3415480144,904365698,1850383289,1513862572,3319794071,1295405312,889832390,1939855244,3156245728,4146028063,515461059,805187924,2299609806,1896207320,1271266257,1243240728,2141411320,901495592,1188158467,1911018281,1992479668,322455233,3448278456,3602020720,3959430224,1782290729,1757510927,1270616988,2400636880,2695052987,1348008463,4261377316,1894135991,1413805550,154594997,1914932102,3501489959,1956957045,2899346010,719986694,1225218442,2761243243,3644590819,2324777568,48102773,2529782497,2204868737,1737721734,3125666675,1018675657,364060950,588812363,733436862,64426239,1098704418,3753992765,330495370,640739952,4028433397,2650328192,1658091870,3249406448,1647446593,2941159038,3954552399,4192215550,3692127173,3877671446,512963634,1012266287,988713674,1807575738,1809683270,3890178974,1570730162,4099655413,1295995868,20678954,437178652,2403511721,3556331611,3948126790,2026665164,1454800603,1352623072,3275226269,3474970393,3396078305,85085188,965829190,408012509,261134166,2913514781,1353665439,1434381638,3781917518,2844384011,4116746011,3338127567,1168134562,2619256621,1907692405,1555759648,1240900636,1755287568,2624662285,2545441025,804030211,3952381974,4204231966,463844512,1839354360,3363613591,1354938150,2248077475,1031708500,2961043709,1035706753,3734024420,363821236,3037742729,3662976202,1888278194,318507885,1127266172,761400640,611582178,1491417316,4263026598,3065456139,3642055941,2764022896,2218870026,4102466555,860129482,3790179739,3919046706,1460233941,1233429914,326531747,899421299,967593602,916237466,835927452,3944499413,3578067148,1225932146,3524048743,527896500,378107753,3744919306,519447257,816226110,3788735702,1088377429,4011221335,1775726900,3220447010,3083204240,1629211243,89170914,3235181578,2016012805,2667390962,232080813,373258392,3938466192,580052964,1185732754,1280357103,1807369531,412657235,3009586773,2869083297,1734055389,599973958,4158230400,825590060,2790343981,1774608972,485616617,3527744242,3058977440,2783343319,1623057413,4151251551,884270966,1167794602,2647071481,1264143181,2128847632,1155430153,63343972,2077401013,3827400438,2850298767,431435534,75751731,393066809,562926157,1602805362,570972678,2713593490,4169243012,2990577698,3394671016,4153713659,1456777724,3027027160,2748056146,2369166336,3293171830,958656961,1530132840,83855856,3933880408,302599924,318056412,127159156,1733141954,1556200566,3405889705,723886162,2354091185,4041926671,1813252995,2309119911,2905033481,1456310909,2650860263,1813524059,378869001,455227179,1374245449,216308531,4109452668,3850911317,3654867687,813298298,3113457769,1877651266,4194364767,384536614,3673447158,2445672900,3154190977,924628909,4276501328,2146602537,3599186740,1250618149,2283982300,570746033,2946434847,3080151084,937333806,2994366532,65472662,513479721,2699721583,82950554,1490910449,1497291473,1108808192,1346068496,3215958305,1852719580,3277331278,183126105,449424689,835750161,2093288945,3171736488,292749319,294046008,822136561,1502749947,1974674794,1834421775,1951382024,774251476,3452961092,1147478277,115185207,1820418453,3986037724,3237389085,575168410,2534060642,3402918889,1059623649,991754890,3314194239,326819557,3066900052,3791737723,3437996139,1495788978,2209272089,53592449,3862637244,1307843474,2153401110,4025082648,1615783837,2128997307,688860244,1197673098,2802644136,483243021,1498274406,218911672,1413131949,803882694,3212143430,3683080620,2752903840,146100699,1566730742,1956708369]}
diff --git a/lib/node_modules/@stdlib/random/base/pcg32/test/test.factory.js b/lib/node_modules/@stdlib/random/base/pcg32/test/test.factory.js
new file mode 100644
index 000000000000..cc68cdadefcc
--- /dev/null
+++ b/lib/node_modules/@stdlib/random/base/pcg32/test/test.factory.js
@@ -0,0 +1,1995 @@
+/* eslint-disable max-lines */
+
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2026 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+'use strict';
+
+// MODULES //
+
+var tape = require( 'tape' );
+var ENV = require( '@stdlib/process/env' );
+var UINT32_MAX = require( '@stdlib/constants/uint32/max' );
+var hasOwnProp = require( '@stdlib/assert/has-own-property' );
+var isBetween = require( '@stdlib/assert/is-between' );
+var isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive;
+var isMethod = require( '@stdlib/assert/is-method' );
+var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;
+var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;
+var isSameArrayLike = require( '@stdlib/assert/is-same-array-like' );
+var isUint32Array = require( '@stdlib/assert/is-uint32array' );
+var Uint32Array = require( '@stdlib/array/uint32' );
+var kstest = require( '@stdlib/stats/kstest' );
+var minstd = require( '@stdlib/random/base/minstd-shuffle' );
+var gcopy = require( '@stdlib/blas/base/gcopy' );
+var typedarray2json = require( '@stdlib/array/to-json' );
+var zeros = require( '@stdlib/array/base/zeros' );
+var factory = require( './../lib/factory.js' );
+
+
+// VARIABLES //
+
+var opts = {
+ 'skip': ( ENV.TEST_MODE === 'coverage' )
+};
+
+
+// FIXTURES //
+
+var UINT32_INTEGER_SEED = require( './fixtures/uint32_integer_seed.json' );
+var UINT32_ARRAY_SEED = require( './fixtures/uint32_array_seed.json' );
+var FLOAT64_INTEGER_SEED = require( './fixtures/float64_integer_seed.json' );
+var FLOAT64_ARRAY_SEED = require( './fixtures/float64_array_seed.json' );
+
+
+// TESTS //
+
+tape( 'main export is a function', function test( t ) {
+ t.ok( true, __filename );
+ t.strictEqual( typeof factory, 'function', 'main export is a function' );
+ t.end();
+});
+
+tape( 'if provided an options argument which is not an object, the factory function throws an error', function test( t ) {
+ var values;
+ var i;
+
+ values = [
+ '5',
+ 3,
+ NaN,
+ true,
+ false,
+ null,
+ void 0,
+ [],
+ function noop() {}
+ ];
+
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValue( values[i] ), TypeError, 'throws a type error when provided '+values[i] );
+ }
+ t.end();
+
+ function badValue( value ) {
+ return function badValue() {
+ factory( value );
+ };
+ }
+});
+
+tape( 'if provided a `copy` option which is not a boolean, the factory function throws an error', function test( t ) {
+ var values;
+ var i;
+
+ values = [
+ '5',
+ 5,
+ NaN,
+ null,
+ void 0,
+ {},
+ [],
+ function noop() {}
+ ];
+
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValue( values[i] ), TypeError, 'throws a type error when provided '+values[i] );
+ }
+ t.end();
+
+ function badValue( value ) {
+ return function badValue() {
+ factory({
+ 'copy': value
+ });
+ };
+ }
+});
+
+tape( 'if provided a `seed` which is not a nonnegative integer or a non-empty array-like object, the factory function throws an error', function test( t ) {
+ var values;
+ var i;
+
+ values = [
+ '5',
+ 3.14,
+ -5.0,
+ NaN,
+ true,
+ false,
+ null,
+ void 0,
+ {},
+ [],
+ function noop() {}
+ ];
+
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValue( values[i] ), TypeError, 'throws a type error when provided '+values[i] );
+ }
+ t.end();
+
+ function badValue( value ) {
+ return function badValue() {
+ factory({
+ 'seed': value
+ });
+ };
+ }
+});
+
+tape( 'the function throws a range error if provided a `seed` greater than the maximum 32-bit unsigned integer (integer seed)', function test( t ) {
+ var values;
+ var i;
+
+ values = [
+ UINT32_MAX + 1,
+ UINT32_MAX + 2,
+ UINT32_MAX + 3
+ ];
+
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValue( values[i] ), RangeError, 'throws a range error when provided '+values[i] );
+ }
+ t.end();
+
+ function badValue( value ) {
+ return function badValue() {
+ factory({
+ 'seed': value
+ });
+ };
+ }
+});
+
+tape( 'if provided a `state` option which is not a Uint32Array, the factory function throws an error', function test( t ) {
+ var values;
+ var i;
+
+ values = [
+ '5',
+ 5,
+ NaN,
+ true,
+ false,
+ null,
+ void 0,
+ {},
+ [],
+ function noop() {}
+ ];
+
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValue( values[i] ), TypeError, 'throws a type error when provided '+values[i] );
+ }
+ t.end();
+
+ function badValue( value ) {
+ return function badValue() {
+ factory({
+ 'state': value
+ });
+ };
+ }
+});
+
+tape( 'if provided a `state` option having an insufficient length, the factory function throws an error', function test( t ) {
+ var values;
+ var i;
+
+ values = [
+ new Uint32Array( 0 ),
+ new Uint32Array( 5 ),
+ new Uint32Array( 9 )
+ ];
+
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValue( values[i] ), RangeError, 'throws an error when provided '+values[i] );
+ }
+ t.end();
+
+ function badValue( value ) {
+ return function badValue() {
+ factory({
+ 'state': value
+ });
+ };
+ }
+});
+
+tape( 'if provided a `state` option containing an unsupported version, the factory function throws an error', function test( t ) {
+ var values;
+ var v;
+ var i;
+
+ values = [];
+
+ v = new Uint32Array( 10 ); // minimum state length is 10
+ v[ 0 ] = 0; // version
+ v[ 1 ] = 3; // number of sections
+ v[ 2 ] = 2; // state length
+ v[ 5 ] = 2; // increment length
+ v[ 8 ] = 1; // seed length
+ values.push( v );
+
+ v = new Uint32Array( 11 );
+ v[ 0 ] = 0; // version
+ v[ 1 ] = 3; // number of sections
+ v[ 2 ] = 2; // state length
+ v[ 5 ] = 2; // increment length
+ v[ 8 ] = 2; // seed length
+ values.push( v );
+
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValue( values[i] ), RangeError, 'throws an error when provided '+values[i] );
+ }
+ t.end();
+
+ function badValue( value ) {
+ return function badValue() {
+ factory({
+ 'state': value
+ });
+ };
+ }
+});
+
+tape( 'if provided a `state` option containing an unsupported number of sections, the factory function throws an error', function test( t ) {
+ var values;
+ var v;
+ var i;
+
+ values = [];
+
+ v = new Uint32Array( 10 );
+ v[ 0 ] = 1; // version
+ v[ 1 ] = 2; // number of sections
+ v[ 2 ] = 2; // state length
+ v[ 5 ] = 2; // increment length
+ v[ 8 ] = 1; // seed length
+ values.push( v );
+
+ v = new Uint32Array( 11 );
+ v[ 0 ] = 1; // version
+ v[ 1 ] = 1; // number of sections
+ v[ 2 ] = 2; // state length
+ v[ 5 ] = 2; // increment length
+ v[ 8 ] = 2; // seed length
+ values.push( v );
+
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValue( values[i] ), RangeError, 'throws an error when provided '+values[i] );
+ }
+ t.end();
+
+ function badValue( value ) {
+ return function badValue() {
+ factory({
+ 'state': value
+ });
+ };
+ }
+});
+
+tape( 'if provided a `state` option containing an unsupported state length, the factory function throws an error', function test( t ) {
+ var values;
+ var v;
+ var i;
+
+ values = [];
+
+ v = new Uint32Array( 10 );
+ v[ 0 ] = 1; // version
+ v[ 1 ] = 3; // number of sections
+ v[ 2 ] = 1; // state length
+ v[ 5 ] = 2; // increment length
+ v[ 8 ] = 1; // seed length
+ values.push( v );
+
+ v = new Uint32Array( 11 );
+ v[ 0 ] = 1; // version
+ v[ 1 ] = 3; // number of sections
+ v[ 2 ] = 3; // state length
+ v[ 5 ] = 2; // increment length
+ v[ 8 ] = 2; // seed length
+ values.push( v );
+
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValue( values[i] ), RangeError, 'throws an error when provided '+values[i] );
+ }
+ t.end();
+
+ function badValue( value ) {
+ return function badValue() {
+ factory({
+ 'state': value
+ });
+ };
+ }
+});
+
+tape( 'if provided a `state` option containing an unsupported increment length, the factory function throws an error', function test( t ) {
+ var values;
+ var v;
+ var i;
+
+ values = [];
+
+ v = new Uint32Array( 10 );
+ v[ 0 ] = 1; // version
+ v[ 1 ] = 3; // number of sections
+ v[ 2 ] = 2; // state length
+ v[ 5 ] = 1; // increment length
+ v[ 8 ] = 1; // seed length
+ values.push( v );
+
+ v = new Uint32Array( 11 );
+ v[ 0 ] = 1; // version
+ v[ 1 ] = 3; // number of sections
+ v[ 2 ] = 2; // state length
+ v[ 5 ] = 3; // increment length
+ v[ 8 ] = 2; // seed length
+ values.push( v );
+
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValue( values[i] ), RangeError, 'throws an error when provided '+values[i] );
+ }
+ t.end();
+
+ function badValue( value ) {
+ return function badValue() {
+ factory({
+ 'state': value
+ });
+ };
+ }
+});
+
+tape( 'if provided a `state` option containing an incompatible seed length, the factory function throws an error', function test( t ) {
+ var values;
+ var v;
+ var i;
+
+ values = [];
+
+ v = new Uint32Array( 10 );
+ v[ 0 ] = 1; // version
+ v[ 1 ] = 3; // number of sections
+ v[ 2 ] = 2; // state length
+ v[ 5 ] = 2; // increment length
+ v[ 8 ] = 2; // seed length
+ values.push( v );
+
+ v = new Uint32Array( 11 );
+ v[ 0 ] = 1; // version
+ v[ 1 ] = 3; // number of sections
+ v[ 2 ] = 2; // state length
+ v[ 5 ] = 2; // increment length
+ v[ 8 ] = 1; // seed length
+ values.push( v );
+
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValue( values[i] ), RangeError, 'throws an error when provided '+values[i] );
+ }
+ t.end();
+
+ function badValue( value ) {
+ return function badValue() {
+ factory({
+ 'state': value
+ });
+ };
+ }
+});
+
+tape( 'the function returns a pseudorandom number generator (no options)', function test( t ) {
+ var pcg32;
+ var v;
+ var i;
+
+ pcg32 = factory();
+ for ( i = 0; i < 1e3; i++ ) {
+ v = pcg32();
+ t.strictEqual( isInteger( v ), true, 'returns expected value' );
+ t.strictEqual( isBetween( v, 0, UINT32_MAX ), true, 'returns expected value' );
+ }
+ t.end();
+});
+
+tape( 'the function returns a pseudorandom number generator (options; no seed)', function test( t ) {
+ var pcg32;
+ var v;
+ var i;
+
+ pcg32 = factory( {} );
+ for ( i = 0; i < 1e3; i++ ) {
+ v = pcg32();
+ t.strictEqual( isInteger( v ), true, 'returns expected value' );
+ t.strictEqual( isBetween( v, 0, UINT32_MAX ), true, 'returns expected value' );
+ }
+ t.end();
+});
+
+tape( 'the function returns a seeded pseudorandom number generator (integer seed)', function test( t ) {
+ var pcg32a;
+ var pcg32b;
+ var seed;
+ var v1;
+ var v2;
+ var i;
+
+ seed = minstd();
+
+ pcg32a = factory({
+ 'seed': seed
+ });
+ pcg32b = factory({
+ 'seed': seed
+ });
+
+ t.notEqual( pcg32a, pcg32b, 'separate generators' );
+
+ for ( i = 0; i < 1e3; i++ ) {
+ v1 = pcg32a();
+ v2 = pcg32b();
+ t.strictEqual( v1, v2, 'both return same number' );
+ }
+ t.end();
+});
+
+tape( 'the function returns a seeded pseudorandom number generator (array seed; length=1)', function test( t ) {
+ var pcg32a;
+ var pcg32b;
+ var seed;
+ var v1;
+ var v2;
+ var i;
+
+ seed = [ minstd() ];
+
+ pcg32a = factory({
+ 'seed': seed
+ });
+ pcg32b = factory({
+ 'seed': seed
+ });
+
+ t.notEqual( pcg32a, pcg32b, 'separate generators' );
+
+ for ( i = 0; i < 1e3; i++ ) {
+ v1 = pcg32a();
+ v2 = pcg32b();
+ t.strictEqual( v1, v2, 'both return same number' );
+ }
+ t.end();
+});
+
+tape( 'the function returns a seeded pseudorandom number generator (array seed; length>1)', function test( t ) {
+ var pcg32a;
+ var pcg32b;
+ var seed;
+ var v1;
+ var v2;
+ var i;
+
+ seed = [ minstd(), minstd(), minstd() ];
+
+ pcg32a = factory({
+ 'seed': seed
+ });
+ pcg32b = factory({
+ 'seed': seed
+ });
+
+ t.notEqual( pcg32a, pcg32b, 'separate generators' );
+
+ for ( i = 0; i < 1e3; i++ ) {
+ v1 = pcg32a();
+ v2 = pcg32b();
+ t.strictEqual( v1, v2, 'both return same number' );
+ }
+ t.end();
+});
+
+tape( 'attached to the returned function is a read-only `NAME` property', function test( t ) {
+ var pcg32 = factory();
+ t.strictEqual( hasOwnProp( pcg32, 'NAME' ), true, 'returns expected value' );
+ t.strictEqual( pcg32.NAME, 'pcg32', 'returns expected value' );
+ t.throws( foo, Error, 'throws an error' );
+ t.end();
+
+ function foo() {
+ pcg32.NAME = 'foo';
+ }
+});
+
+tape( 'attached to the returned function is a read-only `MIN` property', function test( t ) {
+ var pcg32 = factory();
+ t.strictEqual( hasOwnProp( pcg32, 'MIN' ), true, 'returns expected value' );
+ t.strictEqual( pcg32.MIN, 0, 'returns expected value' );
+ t.throws( foo, Error, 'throws an error' );
+ t.end();
+
+ function foo() {
+ pcg32.MIN = 1;
+ }
+});
+
+tape( 'attached to the returned function is a read-only `MAX` property', function test( t ) {
+ var pcg32 = factory();
+ t.strictEqual( hasOwnProp( pcg32, 'MAX' ), true, 'returns expected value' );
+ t.strictEqual( pcg32.MAX, UINT32_MAX, 'returns expected value' );
+ t.throws( foo, Error, 'throws an error' );
+ t.end();
+
+ function foo() {
+ pcg32.MAX = 2;
+ }
+});
+
+tape( 'attached to the returned function is a read-only `seed` property (integer seed)', function test( t ) {
+ var actual;
+ var pcg32;
+
+ pcg32 = factory({
+ 'seed': 1234
+ });
+ actual = pcg32.seed;
+
+ t.strictEqual( hasOwnProp( pcg32, 'seed' ), true, 'returns expected value' );
+ t.strictEqual( isUint32Array( actual ), true, 'returns expected value' );
+ t.strictEqual( isSameArrayLike( actual, [ 1234 ] ), true, 'returns expected value' );
+ t.throws( foo, Error, 'throws an error' );
+ t.end();
+
+ function foo() {
+ pcg32.seed = new Uint32Array( 1 );
+ }
+});
+
+tape( 'attached to the returned function is a read-only `seed` property (array seed; length=1)', function test( t ) {
+ var actual;
+ var pcg32;
+
+ pcg32 = factory({
+ 'seed': [ 1234 ]
+ });
+ actual = pcg32.seed;
+
+ t.strictEqual( hasOwnProp( pcg32, 'seed' ), true, 'returns expected value' );
+ t.strictEqual( isUint32Array( actual ), true, 'returns expected value' );
+ t.strictEqual( isSameArrayLike( actual, [ 1234 ] ), true, 'returns expected value' );
+ t.throws( foo, Error, 'throws an error' );
+ t.end();
+
+ function foo() {
+ pcg32.seed = new Uint32Array( 1 );
+ }
+});
+
+tape( 'attached to the returned function is a read-only `seed` property (array seed; length>1)', function test( t ) {
+ var actual;
+ var pcg32;
+ var seed;
+
+ seed = [ minstd(), minstd(), minstd(), minstd(), minstd() ];
+ pcg32 = factory({
+ 'seed': seed
+ });
+
+ actual = pcg32.seed;
+ t.strictEqual( hasOwnProp( pcg32, 'seed' ), true, 'returns expected value' );
+ t.strictEqual( isUint32Array( actual ), true, 'returns expected value' );
+ t.strictEqual( isSameArrayLike( actual, seed ), true, 'returns expected value' );
+ t.throws( foo, Error, 'throws an error' );
+ t.end();
+
+ function foo() {
+ pcg32.seed = new Uint32Array( 1 );
+ }
+});
+
+tape( 'attached to the returned function is a read-only `seedLength` property', function test( t ) {
+ var pcg32 = factory();
+ t.strictEqual( hasOwnProp( pcg32, 'seedLength' ), true, 'returns expected value' );
+ t.strictEqual( isPositiveInteger( pcg32.seedLength ), true, 'returns expected value' );
+ t.throws( foo, Error, 'throws an error' );
+ t.end();
+
+ function foo() {
+ pcg32.seedLength = 2;
+ }
+});
+
+tape( 'attached to the returned function is a `state` property', function test( t ) {
+ var pcg32 = factory();
+ t.strictEqual( hasOwnProp( pcg32, 'state' ), true, 'returns expected value' );
+ t.strictEqual( isUint32Array( pcg32.state ), true, 'returns expected value' );
+ t.end();
+});
+
+tape( 'attached to the returned function is a read-only `stateLength` property', function test( t ) {
+ var pcg32 = factory();
+ t.strictEqual( hasOwnProp( pcg32, 'stateLength' ), true, 'returns expected value' );
+ t.strictEqual( isPositiveInteger( pcg32.stateLength ), true, 'returns expected value' );
+ t.throws( foo, Error, 'throws an error' );
+ t.end();
+
+ function foo() {
+ pcg32.stateLength = 1;
+ }
+});
+
+tape( 'attached to the returned function is a read-only `byteLength` property', function test( t ) {
+ var pcg32 = factory();
+ t.strictEqual( hasOwnProp( pcg32, 'byteLength' ), true, 'returns expected value' );
+ t.strictEqual( isPositiveInteger( pcg32.byteLength ), true, 'returns expected value' );
+ t.throws( foo, Error, 'throws an error' );
+ t.end();
+
+ function foo() {
+ pcg32.byteLength = 1;
+ }
+});
+
+tape( 'attached to the returned function is a `toJSON` method', function test( t ) {
+ var pcg32;
+ var o;
+
+ pcg32 = factory();
+ t.strictEqual( isMethod( pcg32, 'toJSON' ), true, 'returns expected value' );
+
+ o = pcg32.toJSON();
+ t.strictEqual( o.type, 'PRNG', 'returns expected value' );
+ t.strictEqual( o.name, pcg32.NAME, 'returns expected value' );
+ t.deepEqual( o.state, typedarray2json( pcg32.state ), 'returns expected value' );
+ t.deepEqual( o.params, [], 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'if the `state` property is set to a value other than a Uint32Array, an error is thrown', function test( t ) {
+ var values;
+ var pcg32;
+ var i;
+
+ pcg32 = factory();
+
+ values = [
+ '3',
+ 3,
+ NaN,
+ true,
+ false,
+ null,
+ void 0,
+ [],
+ {},
+ function noop() {}
+ ];
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValue( values[i] ), TypeError, 'throws an error when set to '+values[i] );
+ }
+ t.end();
+
+ function badValue( value ) {
+ return function badValue() {
+ pcg32.state = value;
+ };
+ }
+});
+
+tape( 'if the `state` property is set to a Uint32Array having an unexpected length, an error is thrown', function test( t ) {
+ var values;
+ var pcg32;
+ var i;
+
+ pcg32 = factory();
+
+ values = [
+ new Uint32Array( 0 ),
+ new Uint32Array( 5 ),
+ new Uint32Array( 9 )
+ ];
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValue( values[i] ), RangeError, 'throws an error when set to '+values[i] );
+ }
+ t.end();
+
+ function badValue( value ) {
+ return function badValue() {
+ pcg32.state = value;
+ };
+ }
+});
+
+tape( 'if the `state` property is set to a Uint32Array containing an unsupported version, an error is thrown', function test( t ) {
+ var values;
+ var pcg32;
+ var v;
+ var i;
+
+ pcg32 = factory();
+
+ values = [];
+
+ v = new Uint32Array( 10 );
+ v[ 0 ] = 0; // version
+ v[ 1 ] = 3; // number of sections
+ v[ 2 ] = 2; // state length
+ v[ 5 ] = 2; // increment length
+ v[ 8 ] = 1; // seed length
+ values.push( v );
+
+ v = new Uint32Array( 11 );
+ v[ 0 ] = 0; // version
+ v[ 1 ] = 3; // number of sections
+ v[ 2 ] = 2; // state length
+ v[ 5 ] = 2; // increment length
+ v[ 8 ] = 2; // seed length
+ values.push( v );
+
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValue( values[i] ), RangeError, 'throws an error when provided '+values[i] );
+ }
+ t.end();
+
+ function badValue( value ) {
+ return function badValue() {
+ pcg32.state = value;
+ };
+ }
+});
+
+tape( 'if the `state` property is set to a Uint32Array containing an unsupported number of sections, an error is thrown', function test( t ) {
+ var values;
+ var pcg32;
+ var v;
+ var i;
+
+ pcg32 = factory();
+
+ values = [];
+
+ v = new Uint32Array( 10 );
+ v[ 0 ] = 1; // version
+ v[ 1 ] = 2; // number of sections
+ v[ 2 ] = 2; // state length
+ v[ 5 ] = 2; // increment length
+ v[ 8 ] = 1; // seed length
+ values.push( v );
+
+ v = new Uint32Array( 11 );
+ v[ 0 ] = 1; // version
+ v[ 1 ] = 1; // number of sections
+ v[ 2 ] = 2; // state length
+ v[ 5 ] = 2; // increment length
+ v[ 8 ] = 2; // seed length
+ values.push( v );
+
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValue( values[i] ), RangeError, 'throws an error when provided '+values[i] );
+ }
+ t.end();
+
+ function badValue( value ) {
+ return function badValue() {
+ pcg32.state = value;
+ };
+ }
+});
+
+tape( 'if the `state` property is set to a Uint32Array containing an unsupported state length, an error is thrown', function test( t ) {
+ var values;
+ var pcg32;
+ var v;
+ var i;
+
+ pcg32 = factory();
+
+ values = [];
+
+ v = new Uint32Array( 10 );
+ v[ 0 ] = 1; // version
+ v[ 1 ] = 3; // number of sections
+ v[ 2 ] = 1; // state length
+ v[ 5 ] = 2; // increment length
+ v[ 8 ] = 1; // seed length
+ values.push( v );
+
+ v = new Uint32Array( 11 );
+ v[ 0 ] = 1; // version
+ v[ 1 ] = 3; // number of sections
+ v[ 2 ] = 3; // state length
+ v[ 5 ] = 2; // increment length
+ v[ 8 ] = 2; // seed length
+ values.push( v );
+
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValue( values[i] ), RangeError, 'throws an error when provided '+values[i] );
+ }
+ t.end();
+
+ function badValue( value ) {
+ return function badValue() {
+ pcg32.state = value;
+ };
+ }
+});
+
+tape( 'if the `state` property is set to a Uint32Array containing an unsupported increment length, an error is thrown', function test( t ) {
+ var values;
+ var pcg32;
+ var v;
+ var i;
+
+ pcg32 = factory();
+
+ values = [];
+
+ v = new Uint32Array( 10 );
+ v[ 0 ] = 1; // version
+ v[ 1 ] = 3; // number of sections
+ v[ 2 ] = 2; // state length
+ v[ 5 ] = 1; // increment length
+ v[ 8 ] = 1; // seed length
+ values.push( v );
+
+ v = new Uint32Array( 11 );
+ v[ 0 ] = 1; // version
+ v[ 1 ] = 3; // number of sections
+ v[ 2 ] = 2; // state length
+ v[ 5 ] = 3; // increment length
+ v[ 8 ] = 2; // seed length
+ values.push( v );
+
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValue( values[i] ), RangeError, 'throws an error when provided '+values[i] );
+ }
+ t.end();
+
+ function badValue( value ) {
+ return function badValue() {
+ pcg32.state = value;
+ };
+ }
+});
+
+tape( 'if the `state` property is set to a Uint32Array containing an incompatible seed length, an error is thrown', function test( t ) {
+ var values;
+ var pcg32;
+ var v;
+ var i;
+
+ pcg32 = factory();
+
+ values = [];
+
+ v = new Uint32Array( 10 );
+ v[ 0 ] = 1; // version
+ v[ 1 ] = 3; // number of sections
+ v[ 2 ] = 2; // state length
+ v[ 5 ] = 2; // increment length
+ v[ 8 ] = 2; // seed length
+ values.push( v );
+
+ v = new Uint32Array( 11 );
+ v[ 0 ] = 1; // version
+ v[ 1 ] = 3; // number of sections
+ v[ 2 ] = 2; // state length
+ v[ 5 ] = 2; // increment length
+ v[ 8 ] = 1; // seed length
+ values.push( v );
+
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValue( values[i] ), RangeError, 'throws an error when provided '+values[i] );
+ }
+ t.end();
+
+ function badValue( value ) {
+ return function badValue() {
+ pcg32.state = value;
+ };
+ }
+});
+
+tape( 'attached to the returned function is a `normalized` method for generating pseudorandom numbers strictly between 0 (inclusive) and 1 (exclusive)', function test( t ) {
+ var pcg32;
+ var v;
+ var i;
+
+ pcg32 = factory();
+ t.strictEqual( isMethod( pcg32, 'normalized' ), true, 'returns expected value' );
+
+ for ( i = 0; i < 1e3; i++ ) {
+ v = pcg32.normalized();
+ t.strictEqual( isNumber( v ), true, 'returns expected value' );
+ t.strictEqual( isBetween( v, 0.0, 1.0, 'closed', 'open' ), true, 'returns expected value' );
+ }
+ t.end();
+});
+
+tape( 'attached to the `normalized` method is a read-only `NAME` property', function test( t ) {
+ var pcg32 = factory();
+ t.strictEqual( hasOwnProp( pcg32.normalized, 'NAME' ), true, 'returns expected value' );
+ t.strictEqual( pcg32.normalized.NAME, 'pcg32', 'returns expected value' );
+ t.throws( foo, Error, 'throws an error' );
+ t.end();
+
+ function foo() {
+ pcg32.normalized.NAME = 'foo';
+ }
+});
+
+tape( 'attached to the `normalized` method is a read-only `MIN` property', function test( t ) {
+ var pcg32 = factory();
+ t.strictEqual( hasOwnProp( pcg32.normalized, 'MIN' ), true, 'returns expected value' );
+ t.strictEqual( pcg32.normalized.MIN, 0.0, 'returns expected value' );
+ t.throws( foo, Error, 'throws an error' );
+ t.end();
+
+ function foo() {
+ pcg32.normalized.MIN = 1;
+ }
+});
+
+tape( 'attached to the `normalized` method is a read-only `MAX` property', function test( t ) {
+ var pcg32 = factory();
+ t.strictEqual( hasOwnProp( pcg32.normalized, 'MAX' ), true, 'returns expected value' );
+ t.strictEqual( pcg32.normalized.MAX, UINT32_MAX / ( UINT32_MAX + 1.0 ), 'returns expected value' );
+ t.throws( foo, Error, 'throws an error' );
+ t.end();
+
+ function foo() {
+ pcg32.normalized.MAX = 2;
+ }
+});
+
+tape( 'attached to the `normalized` method is a read-only `seed` property (integer seed)', function test( t ) {
+ var actual;
+ var pcg32;
+
+ pcg32 = factory({
+ 'seed': 1234
+ });
+ actual = pcg32.normalized.seed;
+
+ t.strictEqual( hasOwnProp( pcg32.normalized, 'seed' ), true, 'returns expected value' );
+ t.strictEqual( isUint32Array( actual ), true, 'returns expected value' );
+ t.strictEqual( isSameArrayLike( actual, [ 1234 ] ), true, 'returns expected value' );
+ t.throws( foo, Error, 'throws an error' );
+ t.end();
+
+ function foo() {
+ pcg32.normalized.seed = new Uint32Array( 1 );
+ }
+});
+
+tape( 'attached to the `normalized` method is a read-only `seed` property (array seed; length=1)', function test( t ) {
+ var actual;
+ var pcg32;
+
+ pcg32 = factory({
+ 'seed': [ 1234 ]
+ });
+ actual = pcg32.normalized.seed;
+
+ t.strictEqual( hasOwnProp( pcg32.normalized, 'seed' ), true, 'returns expected value' );
+ t.strictEqual( isUint32Array( actual ), true, 'returns expected value' );
+ t.strictEqual( isSameArrayLike( actual, [ 1234 ] ), true, 'returns expected value' );
+ t.throws( foo, Error, 'throws an error' );
+ t.end();
+
+ function foo() {
+ pcg32.normalized.seed = new Uint32Array( 1 );
+ }
+});
+
+tape( 'attached to the `normalized` method is a read-only `seed` property (array seed; length>1)', function test( t ) {
+ var actual;
+ var pcg32;
+ var seed;
+
+ seed = [ minstd(), minstd(), minstd(), minstd(), minstd() ];
+ pcg32 = factory({
+ 'seed': seed
+ });
+
+ actual = pcg32.normalized.seed;
+ t.strictEqual( hasOwnProp( pcg32.normalized, 'seed' ), true, 'returns expected value' );
+ t.strictEqual( isUint32Array( actual ), true, 'returns expected value' );
+ t.strictEqual( isSameArrayLike( actual, seed ), true, 'returns expected value' );
+ t.throws( foo, Error, 'throws an error' );
+ t.end();
+
+ function foo() {
+ pcg32.normalized.seed = new Uint32Array( 1 );
+ }
+});
+
+tape( 'attached to the `normalized` method is a read-only `seedLength` property', function test( t ) {
+ var pcg32 = factory();
+ t.strictEqual( hasOwnProp( pcg32.normalized, 'seedLength' ), true, 'returns expected value' );
+ t.strictEqual( isPositiveInteger( pcg32.normalized.seedLength ), true, 'returns expected value' );
+ t.throws( foo, Error, 'throws an error' );
+ t.end();
+
+ function foo() {
+ pcg32.normalized.seedLength = 1;
+ }
+});
+
+tape( 'attached to the `normalized` method is a `state` property', function test( t ) {
+ var pcg32 = factory();
+ t.strictEqual( hasOwnProp( pcg32.normalized, 'state' ), true, 'returns expected value' );
+ t.strictEqual( isUint32Array( pcg32.normalized.state ), true, 'returns expected value' );
+ t.end();
+});
+
+tape( 'attached to the `normalized` method is a read-only `byteLength` property', function test( t ) {
+ var pcg32 = factory();
+ t.strictEqual( hasOwnProp( pcg32.normalized, 'byteLength' ), true, 'returns expected value' );
+ t.strictEqual( isPositiveInteger( pcg32.normalized.byteLength ), true, 'returns expected value' );
+ t.throws( foo, Error, 'throws an error' );
+ t.end();
+
+ function foo() {
+ pcg32.normalized.byteLength = 1;
+ }
+});
+
+tape( 'attached to the `normalized` method is a read-only `stateLength` property', function test( t ) {
+ var pcg32 = factory();
+ t.strictEqual( hasOwnProp( pcg32.normalized, 'stateLength' ), true, 'returns expected value' );
+ t.strictEqual( isPositiveInteger( pcg32.normalized.stateLength ), true, 'returns expected value' );
+ t.throws( foo, Error, 'throws an error' );
+ t.end();
+
+ function foo() {
+ pcg32.normalized.stateLength = 1;
+ }
+});
+
+tape( 'attached to the `normalized` method is a `toJSON` method', function test( t ) {
+ var pcg32;
+ var o;
+
+ pcg32 = factory();
+ t.strictEqual( isMethod( pcg32.normalized, 'toJSON' ), true, 'returns expected value' );
+
+ o = pcg32.normalized.toJSON();
+ t.strictEqual( o.type, 'PRNG', 'returns expected value' );
+ t.strictEqual( o.name, pcg32.normalized.NAME, 'returns expected value' );
+ t.deepEqual( o.state, typedarray2json( pcg32.normalized.state ), 'returns expected value' );
+ t.deepEqual( o.params, [], 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'if the `state` property is set to a value other than a Uint32Array, an error is thrown (normalized)', function test( t ) {
+ var values;
+ var pcg32;
+ var i;
+
+ pcg32 = factory();
+
+ values = [
+ '3',
+ 3,
+ NaN,
+ true,
+ false,
+ null,
+ void 0,
+ [],
+ {},
+ function noop() {}
+ ];
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValue( values[i] ), TypeError, 'throws an error when set to '+values[i] );
+ }
+ t.end();
+
+ function badValue( value ) {
+ return function badValue() {
+ pcg32.normalized.state = value;
+ };
+ }
+});
+
+tape( 'if the `state` property is set to a Uint32Array having an unexpected length, an error is thrown (normalized)', function test( t ) {
+ var values;
+ var pcg32;
+ var i;
+
+ pcg32 = factory();
+
+ values = [
+ new Uint32Array( 0 ),
+ new Uint32Array( 5 ),
+ new Uint32Array( 9 )
+ ];
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValue( values[i] ), RangeError, 'throws an error when set to '+values[i] );
+ }
+ t.end();
+
+ function badValue( value ) {
+ return function badValue() {
+ pcg32.normalized.state = value;
+ };
+ }
+});
+
+tape( 'if the `state` property is set to a Uint32Array containing an unsupported version, an error is thrown (normalized)', function test( t ) {
+ var values;
+ var pcg32;
+ var v;
+ var i;
+
+ pcg32 = factory();
+
+ values = [];
+
+ v = new Uint32Array( 10 ); // minimum state length is 10
+ v[ 0 ] = 0; // version
+ v[ 1 ] = 3; // number of sections
+ v[ 2 ] = 2; // state length
+ v[ 5 ] = 2; // increment length
+ v[ 8 ] = 1; // seed length
+ values.push( v );
+
+ v = new Uint32Array( 11 );
+ v[ 0 ] = 0; // version
+ v[ 1 ] = 3; // number of sections
+ v[ 2 ] = 2; // state length
+ v[ 5 ] = 2; // increment length
+ v[ 8 ] = 2; // seed length
+ values.push( v );
+
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValue( values[i] ), RangeError, 'throws an error when provided '+values[i] );
+ }
+ t.end();
+
+ function badValue( value ) {
+ return function badValue() {
+ pcg32.normalized.state = value;
+ };
+ }
+});
+
+tape( 'if the `state` property is set to a Uint32Array containing an unsupported number of sections, an error is thrown (normalized)', function test( t ) {
+ var values;
+ var pcg32;
+ var v;
+ var i;
+
+ pcg32 = factory();
+
+ values = [];
+
+ v = new Uint32Array( 10 );
+ v[ 0 ] = 1; // version
+ v[ 1 ] = 2; // number of sections
+ v[ 2 ] = 2; // state length
+ v[ 5 ] = 2; // increment length
+ v[ 8 ] = 1; // seed length
+ values.push( v );
+
+ v = new Uint32Array( 11 );
+ v[ 0 ] = 1; // version
+ v[ 1 ] = 1; // number of sections
+ v[ 2 ] = 2; // state length
+ v[ 5 ] = 2; // increment length
+ v[ 8 ] = 2; // seed length
+ values.push( v );
+
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValue( values[i] ), RangeError, 'throws an error when provided '+values[i] );
+ }
+ t.end();
+
+ function badValue( value ) {
+ return function badValue() {
+ pcg32.normalized.state = value;
+ };
+ }
+});
+
+tape( 'if the `state` property is set to a Uint32Array containing an unsupported state length, an error is thrown (normalized)', function test( t ) {
+ var values;
+ var pcg32;
+ var v;
+ var i;
+
+ pcg32 = factory();
+
+ values = [];
+
+ v = new Uint32Array( 10 );
+ v[ 0 ] = 1; // version
+ v[ 1 ] = 3; // number of sections
+ v[ 2 ] = 1; // state length
+ v[ 5 ] = 2; // increment length
+ v[ 8 ] = 1; // seed length
+ values.push( v );
+
+ v = new Uint32Array( 11 );
+ v[ 0 ] = 1; // version
+ v[ 1 ] = 3; // number of sections
+ v[ 2 ] = 3; // state length
+ v[ 5 ] = 2; // increment length
+ v[ 8 ] = 2; // seed length
+ values.push( v );
+
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValue( values[i] ), RangeError, 'throws an error when provided '+values[i] );
+ }
+ t.end();
+
+ function badValue( value ) {
+ return function badValue() {
+ pcg32.normalized.state = value;
+ };
+ }
+});
+
+tape( 'if the `state` property is set to a Uint32Array containing an unsupported increment length, an error is thrown (normalized)', function test( t ) {
+ var values;
+ var pcg32;
+ var v;
+ var i;
+
+ pcg32 = factory();
+
+ values = [];
+
+ v = new Uint32Array( 10 );
+ v[ 0 ] = 1; // version
+ v[ 1 ] = 3; // number of sections
+ v[ 2 ] = 2; // state length
+ v[ 5 ] = 1; // increment length
+ v[ 8 ] = 1; // seed length
+ values.push( v );
+
+ v = new Uint32Array( 11 );
+ v[ 0 ] = 1; // version
+ v[ 1 ] = 3; // number of sections
+ v[ 2 ] = 2; // state length
+ v[ 5 ] = 3; // increment length
+ v[ 8 ] = 2; // seed length
+ values.push( v );
+
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValue( values[i] ), RangeError, 'throws an error when provided '+values[i] );
+ }
+ t.end();
+
+ function badValue( value ) {
+ return function badValue() {
+ pcg32.normalized.state = value;
+ };
+ }
+});
+
+tape( 'if the `state` property is set to a Uint32Array containing an incompatible seed length, an error is thrown (normalized)', function test( t ) {
+ var values;
+ var pcg32;
+ var v;
+ var i;
+
+ pcg32 = factory();
+
+ values = [];
+
+ v = new Uint32Array( 10 );
+ v[ 0 ] = 1; // version
+ v[ 1 ] = 3; // number of sections
+ v[ 2 ] = 2; // state length
+ v[ 5 ] = 2; // increment length
+ v[ 8 ] = 2; // seed length
+ values.push( v );
+
+ v = new Uint32Array( 11 );
+ v[ 0 ] = 1; // version
+ v[ 1 ] = 3; // number of sections
+ v[ 2 ] = 2; // state length
+ v[ 5 ] = 2; // increment length
+ v[ 8 ] = 1; // seed length
+ values.push( v );
+
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValue( values[i] ), RangeError, 'throws an error when provided '+values[i] );
+ }
+ t.end();
+
+ function badValue( value ) {
+ return function badValue() {
+ pcg32.normalized.state = value;
+ };
+ }
+});
+
+tape( 'the `normalized` method returns pseudorandom numbers drawn from a uniform distribution', opts, function test( t ) {
+ var threshold;
+ var count;
+ var npass;
+ var N;
+ var x;
+
+ threshold = 0.10;
+
+ x = zeros( 1e3 );
+ N = 500;
+
+ count = -1;
+ npass = 0;
+
+ gof();
+
+ function gof() {
+ var rejected;
+ var pValue;
+ var pcg32;
+ var bool;
+ var i;
+ var j;
+
+ count += 1;
+ rejected = 0;
+ for ( i = 0; i < N; i++ ) {
+ pcg32 = factory();
+ t.ok( true, 'seed: '+pcg32.seed );
+ for ( j = 0; j < x.length; j++ ) {
+ x[ j ] = pcg32.normalized();
+ if ( x[ j ] < 0.0 || x[ j ] > 1.0 ) {
+ t.ok( false, 'returned a number outside support: '+x[ j ] );
+ }
+ }
+ // Test using Kolmogorov-Smirnov goodness-of-fit test:
+ pValue = kstest( x, 'uniform', 0.0, 1.0 ).pValue;
+ t.strictEqual( typeof pValue, 'number', 'returns a p-value: '+pValue );
+ if ( pValue < 0.05 ) {
+ rejected += 1;
+ }
+ }
+ // Account for small sample size and few repeats...
+ bool = ( rejected / N < threshold );
+
+ // If we succeed the first time, we are done...
+ if ( count === 0 && bool ) {
+ return done( bool, rejected );
+ }
+ // Retry mode...
+ if ( bool ) {
+ npass += 1;
+ }
+ // Retry twice...
+ if ( count < 2 ) {
+ return gof();
+ }
+ // Both retries must succeed for test to pass:
+ bool = ( npass >= 2 );
+ return done( bool, rejected );
+ }
+
+ function done( bool, rejected ) {
+ t.ok( bool, 'null hypothesis (i.e., that numbers are drawn from Uniform(0,1)) is rejected in less than '+(threshold*100)+'% of cases ('+rejected+' of '+N+'). Repeats: '+npass+' of '+count+'.' );
+ t.end();
+ }
+});
+
+tape( 'the function returns pseudorandom numbers from a PCG32 PRNG (integer seed)', function test( t ) {
+ var expected;
+ var rand;
+ var i;
+
+ expected = UINT32_INTEGER_SEED.expected;
+ rand = factory({
+ 'seed': UINT32_INTEGER_SEED.seed
+ });
+ for ( i = 0; i < expected.length; i++ ) {
+ t.strictEqual( rand(), expected[ i ], 'returns expected value for iteration '+i );
+ }
+ t.end();
+});
+
+tape( 'the function returns pseudorandom numbers from a PCG32 PRNG (array seed; length=1)', function test( t ) {
+ var expected;
+ var rand;
+ var i;
+
+ expected = UINT32_INTEGER_SEED.expected;
+ rand = factory({
+ 'seed': [ UINT32_INTEGER_SEED.seed ]
+ });
+ for ( i = 0; i < expected.length; i++ ) {
+ t.strictEqual( rand(), expected[ i ], 'returns expected value for iteration '+i );
+ }
+ t.end();
+});
+
+tape( 'the function returns pseudorandom numbers from a PCG32 PRNG (array seed; length>1)', function test( t ) {
+ var expected;
+ var rand;
+ var i;
+
+ expected = UINT32_ARRAY_SEED.expected;
+ rand = factory({
+ 'seed': UINT32_ARRAY_SEED.seed
+ });
+ for ( i = 0; i < expected.length; i++ ) {
+ t.strictEqual( rand(), expected[ i ], 'returns expected value for iteration '+i );
+ }
+ t.end();
+});
+
+tape( 'the `normalized` method returns pseudorandom double-precision floating-point numbers from a PCG32 PRNG (integer seed)', function test( t ) {
+ var expected;
+ var opts;
+ var rand;
+ var i;
+
+ expected = FLOAT64_INTEGER_SEED.expected;
+
+ opts = {
+ 'seed': FLOAT64_INTEGER_SEED.seed
+ };
+ rand = factory( opts ).normalized;
+ for ( i = 0; i < expected.length; i++ ) {
+ t.strictEqual( rand(), expected[ i ], 'returns expected value for iteration '+i );
+ }
+ t.end();
+});
+
+tape( 'the `normalized` method returns pseudorandom double-precision floating-point numbers from a PCG32 PRNG (array seed; length=1)', function test( t ) {
+ var expected;
+ var opts;
+ var rand;
+ var i;
+
+ expected = FLOAT64_INTEGER_SEED.expected;
+
+ opts = {
+ 'seed': [ FLOAT64_INTEGER_SEED.seed ]
+ };
+ rand = factory( opts ).normalized;
+ for ( i = 0; i < expected.length; i++ ) {
+ t.strictEqual( rand(), expected[ i ], 'returns expected value for iteration '+i );
+ }
+ t.end();
+});
+
+tape( 'the `normalized` method returns pseudorandom double-precision floating-point numbers from a PCG32 PRNG (array seed; length>1)', function test( t ) {
+ var expected;
+ var opts;
+ var rand;
+ var i;
+
+ expected = FLOAT64_ARRAY_SEED.expected;
+
+ opts = {
+ 'seed': FLOAT64_ARRAY_SEED.seed
+ };
+ rand = factory( opts ).normalized;
+ for ( i = 0; i < expected.length; i++ ) {
+ t.strictEqual( rand(), expected[ i ], 'returns expected value for iteration '+i );
+ }
+ t.end();
+});
+
+tape( 'the function supports specifying the generator state', function test( t ) {
+ var pcg32;
+ var state;
+ var arr;
+ var i;
+
+ pcg32 = factory();
+
+ // Move to a future state...
+ for ( i = 0; i < 100; i++ ) {
+ pcg32();
+ }
+ // Capture the current state:
+ state = pcg32.state;
+
+ // Move to a future state...
+ arr = [];
+ for ( i = 0; i < 100; i++ ) {
+ arr.push( pcg32() );
+ }
+
+ // Create another PRNG using the captured state:
+ pcg32 = factory({
+ 'state': state
+ });
+
+ // Replay previously generated values...
+ for ( i = 0; i < 100; i++ ) {
+ t.strictEqual( pcg32(), arr[ i ], 'returns expected value' );
+ }
+ t.end();
+});
+
+tape( 'the function supports specifying a shared generator state', function test( t ) {
+ var shared;
+ var pcg32;
+ var state;
+ var rand1;
+ var rand2;
+ var arr;
+ var v1;
+ var v2;
+ var i;
+ var j;
+
+ pcg32 = factory();
+
+ // Move to a future state...
+ for ( i = 0; i < 100; i++ ) {
+ pcg32();
+ }
+ // Capture the current state:
+ state = pcg32.state;
+
+ // Move to a future state...
+ arr = [];
+ for ( i = 0; i < 100; i++ ) {
+ arr.push( pcg32() );
+ }
+
+ // Create a copy of the state (to prevent mutation) which will be shared by more than one PRNG:
+ shared = new Uint32Array( state );
+
+ // Create PRNGs using the captured state:
+ rand1 = factory({
+ 'state': shared,
+ 'copy': false
+ });
+ rand2 = factory({
+ 'state': shared,
+ 'copy': false
+ });
+
+ // Replay previously generated values...
+ j = 0;
+ for ( i = 0; i < 50; i++ ) {
+ v1 = rand1();
+ v2 = rand2();
+ t.strictEqual( v1, arr[ j ], 'returns expected value' );
+ t.strictEqual( v2, arr[ j+1 ], 'returns expected value' );
+ j += 2; // stride
+ }
+ t.end();
+});
+
+tape( 'the returned function supports setting the generator state', function test( t ) {
+ var pcg32;
+ var state;
+ var arr;
+ var i;
+
+ pcg32 = factory();
+
+ // Move to a future state...
+ for ( i = 0; i < 100; i++ ) {
+ pcg32();
+ }
+ // Capture the current state:
+ state = pcg32.state;
+
+ // Move to a future state...
+ arr = [];
+ for ( i = 0; i < 100; i++ ) {
+ arr.push( pcg32() );
+ }
+ // Set the state:
+ pcg32.state = state;
+
+ // Replay previously generated values...
+ for ( i = 0; i < 100; i++ ) {
+ t.strictEqual( pcg32(), arr[ i ], 'returns expected value' );
+ }
+ t.end();
+});
+
+tape( 'the returned function supports setting the generator state to a state array having a different length', function test( t ) {
+ var shared;
+ var pcg32;
+ var state;
+ var rand1;
+ var rand2;
+ var arr;
+ var v1;
+ var v2;
+ var i;
+
+ // Seed length: 2
+ pcg32 = factory({
+ 'seed': [ 1234, 5678 ]
+ });
+
+ // Move to a future state...
+ for ( i = 0; i < 100; i++ ) {
+ pcg32();
+ }
+ // Capture the current state:
+ state = pcg32.state;
+
+ // Move to a future state...
+ arr = [];
+ for ( i = 0; i < 100; i++ ) {
+ arr.push( pcg32() );
+ }
+
+ // Create a copy of the state (to prevent mutation) which will be shared by more than one PRNG:
+ // NOTE: This is not really shared in the sense of 'in sync'
+ shared = new Uint32Array( state );
+
+ // Create PRNGs having seed lengths equal to 1:
+ rand1 = factory({
+ 'seed': [ 6789 ]
+ });
+ rand2 = factory({
+ 'seed': [ 4321 ]
+ });
+
+ // Move to future states...
+ for ( i = 0; i < 100; i++ ) {
+ v1 = rand1();
+ v2 = rand2();
+ }
+
+ // Reset the PRNG states:
+ rand1.state = shared;
+ rand2.state = shared;
+
+ // Replay previously generated values...
+ for ( i = 0; i < 100; i++ ) {
+ v1 = rand1();
+ t.strictEqual( v1, arr[ i ], 'returns expected value' );
+ v2 = rand2();
+ t.strictEqual( v2, arr[ i ], 'returns expected value' );
+ }
+ t.end();
+});
+
+tape( 'the returned function supports setting the generator state (normalized)', function test( t ) {
+ var pcg32;
+ var state;
+ var arr;
+ var i;
+
+ pcg32 = factory();
+
+ // Move to a future state...
+ for ( i = 0; i < 100; i++ ) {
+ pcg32.normalized();
+ }
+ // Capture the current state:
+ state = pcg32.state;
+
+ // Move to a future state...
+ arr = [];
+ for ( i = 0; i < 100; i++ ) {
+ arr.push( pcg32.normalized() );
+ }
+ // Set the state:
+ pcg32.state = state;
+
+ // Replay previously generated values...
+ for ( i = 0; i < 100; i++ ) {
+ t.strictEqual( pcg32.normalized(), arr[ i ], 'returns expected value' );
+ }
+ t.end();
+});
+
+tape( 'the returned function supports setting the generator state (normalized)', function test( t ) {
+ var pcg32;
+ var state;
+ var arr;
+ var i;
+
+ pcg32 = factory();
+
+ // Move to a future state...
+ for ( i = 0; i < 100; i++ ) {
+ pcg32.normalized();
+ }
+ // Capture the current state:
+ state = pcg32.normalized.state;
+
+ // Move to a future state...
+ arr = [];
+ for ( i = 0; i < 100; i++ ) {
+ arr.push( pcg32.normalized() );
+ }
+ // Set the state:
+ pcg32.normalized.state = state;
+
+ // Replay previously generated values...
+ for ( i = 0; i < 100; i++ ) {
+ t.strictEqual( pcg32.normalized(), arr[ i ], 'returns expected value' );
+ }
+ t.end();
+});
+
+tape( 'the returned function supports setting a shared generator state (same length)', function test( t ) {
+ var shared;
+ var pcg32;
+ var state;
+ var rand1;
+ var rand2;
+ var arr;
+ var v1;
+ var v2;
+ var i;
+ var j;
+
+ pcg32 = factory();
+
+ // Move to a future state...
+ for ( i = 0; i < 100; i++ ) {
+ pcg32();
+ }
+ // Capture the current state:
+ state = pcg32.state;
+
+ // Move to a future state...
+ arr = [];
+ for ( i = 0; i < 100; i++ ) {
+ arr.push( pcg32() );
+ }
+
+ // Create a copy of the state (to prevent mutation) which will be shared by more than one PRNG:
+ shared = new Uint32Array( state );
+
+ // Create PRNGs using the captured state:
+ rand1 = factory({
+ 'state': shared,
+ 'copy': false
+ });
+ rand2 = factory({
+ 'state': shared,
+ 'copy': false
+ });
+
+ // Replay previously generated values...
+ j = 0;
+ for ( i = 0; i < 50; i++ ) {
+ v1 = rand1();
+ v2 = rand2();
+ t.strictEqual( v1, arr[ j ], 'returns expected value' );
+ t.strictEqual( v2, arr[ j+1 ], 'returns expected value' );
+ j += 2; // stride
+ }
+
+ // Move to a future state...
+ for ( i = 0; i < 100; i++ ) {
+ v2 = rand2();
+ }
+
+ // Reset the (shared) state:
+ rand1.state = new Uint32Array( state );
+
+ // Replay previously generated values...
+ j = 0;
+ for ( i = 0; i < 50; i++ ) {
+ v1 = rand1();
+ v2 = rand2();
+ t.strictEqual( v1, arr[ j ], 'returns expected value' );
+ t.strictEqual( v2, arr[ j+1 ], 'returns expected value' );
+ j += 2; // stride
+ }
+ t.end();
+});
+
+tape( 'the returned function supports setting a shared generator state (different length)', function test( t ) {
+ var shared;
+ var pcg32;
+ var state;
+ var rand1;
+ var rand2;
+ var arr;
+ var v1;
+ var v2;
+ var s;
+ var i;
+ var j;
+
+ pcg32 = factory();
+
+ // Move to a future state...
+ for ( i = 0; i < 100; i++ ) {
+ pcg32();
+ }
+ // Capture the current state:
+ state = pcg32.state;
+
+ // Move to a future state...
+ arr = [];
+ for ( i = 0; i < 100; i++ ) {
+ arr.push( pcg32() );
+ }
+
+ // Create a copy of the state (to prevent mutation) which will be shared by more than one PRNG:
+ shared = new Uint32Array( state );
+
+ // Create PRNGs using the captured state:
+ rand1 = factory({
+ 'state': shared,
+ 'copy': false
+ });
+ rand2 = factory({
+ 'state': shared,
+ 'copy': false
+ });
+
+ // Replay previously generated values...
+ j = 0;
+ for ( i = 0; i < 50; i++ ) {
+ v1 = rand1();
+ v2 = rand2();
+ t.strictEqual( v1, arr[ j ], 'returns expected value' );
+ t.strictEqual( v2, arr[ j+1 ], 'returns expected value' );
+ j += 2; // stride
+ }
+
+ // Move to a future state...
+ for ( i = 0; i < 100; i++ ) {
+ v2 = rand2();
+ }
+
+ // Reset the (*previously* shared) state:
+ s = new Uint32Array( state.length+1 );
+ gcopy( state.length, state, 1, s, 1 );
+ s[ s.length-3 ] = 2; // Update seed section length to make valid state array
+ rand1.state = s;
+
+ // Attempt to replay previously generated values...
+ j = 0;
+ for ( i = 0; i < 50; i++ ) {
+ v1 = rand1();
+ v2 = rand2();
+
+ // `rand1()` state is not affected by `rand2()`:
+ t.strictEqual( v1, arr[ i ], 'returns expected value' );
+
+ // `rand2()` state was never reset:
+ t.notEqual( v2, arr[ j+1 ], 'returns expected value' );
+ j += 2; // stride
+ }
+
+ // Reset the (*previously* shared) state:
+ rand2.state = s;
+
+ // Reset to a shared state:
+ shared = new Uint32Array( state );
+ rand1.state = shared;
+ rand2.state = shared;
+
+ // Replay previously generated values...
+ j = 0;
+ for ( i = 0; i < 50; i++ ) {
+ v1 = rand1();
+ v2 = rand2();
+ t.strictEqual( v1, arr[ j ], 'returns expected value' );
+ t.strictEqual( v2, arr[ j+1 ], 'returns expected value' );
+ j += 2; // stride
+ }
+ t.end();
+});
+
+tape( 'the returned function supports setting a shared generator state (no initial shared state)', function test( t ) {
+ var shared;
+ var pcg32;
+ var state;
+ var rand1;
+ var rand2;
+ var arr;
+ var v1;
+ var v2;
+ var i;
+ var j;
+
+ pcg32 = factory();
+
+ // Move to a future state...
+ for ( i = 0; i < 100; i++ ) {
+ pcg32();
+ }
+ // Capture the current state:
+ state = pcg32.state;
+
+ // Create a copy of the state (to prevent mutation) which will be shared by more than one PRNG:
+ shared = new Uint32Array( state );
+
+ // Move to a future state...
+ arr = [];
+ for ( i = 0; i < 100; i++ ) {
+ arr.push( pcg32() );
+ }
+
+ // Create PRNGs using the captured state:
+ rand1 = factory({
+ 'copy': false
+ });
+ rand2 = factory({
+ 'copy': false
+ });
+
+ // Move to a future state...
+ for ( i = 0; i < 100; i++ ) {
+ v1 = rand1();
+ v2 = rand2();
+ }
+
+ // Reset to a shared state:
+ rand1.state = shared;
+ rand2.state = shared;
+
+ // Replay previously generated values...
+ j = 0;
+ for ( i = 0; i < 50; i++ ) {
+ v1 = rand1();
+ v2 = rand2();
+ t.strictEqual( v1, arr[ j ], 'returns expected value' );
+ t.strictEqual( v2, arr[ j+1 ], 'returns expected value' );
+ j += 2; // stride
+ }
+
+ // Create a copy of the state (to prevent mutation) which will be shared by more than one PRNG:
+ shared = new Uint32Array( state );
+
+ // Reset the (shared) state:
+ rand1.state = shared;
+ rand2.state = shared;
+
+ // Replay previously generated values...
+ j = 0;
+ for ( i = 0; i < 50; i++ ) {
+ v1 = rand1();
+ v2 = rand2();
+ t.strictEqual( v1, arr[ j ], 'returns expected value' );
+ t.strictEqual( v2, arr[ j+1 ], 'returns expected value' );
+ j += 2; // stride
+ }
+ t.end();
+});
diff --git a/lib/node_modules/@stdlib/random/base/pcg32/test/test.js b/lib/node_modules/@stdlib/random/base/pcg32/test/test.js
new file mode 100644
index 000000000000..a0fd7ea5bded
--- /dev/null
+++ b/lib/node_modules/@stdlib/random/base/pcg32/test/test.js
@@ -0,0 +1,331 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2026 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+'use strict';
+
+// MODULES //
+
+var tape = require( 'tape' );
+var hasOwnProp = require( '@stdlib/assert/has-own-property' );
+var isBetween = require( '@stdlib/assert/is-between' );
+var isMethod = require( '@stdlib/assert/is-method' );
+var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;
+var isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive;
+var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;
+var isUint32Array = require( '@stdlib/assert/is-uint32array' );
+var Uint32Array = require( '@stdlib/array/uint32' );
+var UINT32_MAX = require( '@stdlib/constants/uint32/max' );
+var pcg32 = require( './../lib' );
+
+
+// TESTS //
+
+tape( 'main export is a function', function test( t ) {
+ t.ok( true, __filename );
+ t.strictEqual( typeof pcg32, 'function', 'main export is a function' );
+ t.end();
+});
+
+tape( 'attached to the main export is a `normalized` method', function test( t ) {
+ t.strictEqual( isMethod( pcg32, 'normalized' ), true, 'returns expected value' );
+ t.end();
+});
+
+tape( 'attached to the main export is a `factory` method', function test( t ) {
+ t.strictEqual( isMethod( pcg32, 'factory' ), true, 'returns expected value' );
+ t.end();
+});
+
+tape( 'attached to the main export is a `toJSON` method', function test( t ) {
+ t.strictEqual( isMethod( pcg32, 'toJSON' ), true, 'returns expected value' );
+ t.end();
+});
+
+tape( 'attached to the main export is a read-only `NAME` property', function test( t ) {
+ t.strictEqual( hasOwnProp( pcg32, 'NAME' ), true, 'returns expected value' );
+ t.strictEqual( pcg32.NAME, 'pcg32', 'returns expected value' );
+ t.throws( foo, Error, 'throws an error' );
+ t.end();
+
+ function foo() {
+ pcg32.NAME = 'foo';
+ }
+});
+
+tape( 'attached to the main export is a read-only `MIN` property', function test( t ) {
+ t.strictEqual( hasOwnProp( pcg32, 'MIN' ), true, 'returns expected value' );
+ t.strictEqual( pcg32.MIN, 0, 'returns expected value' );
+ t.throws( foo, Error, 'throws an error' );
+ t.end();
+
+ function foo() {
+ pcg32.MIN = 1;
+ }
+});
+
+tape( 'attached to the main export is a read-only `MAX` property', function test( t ) {
+ t.strictEqual( hasOwnProp( pcg32, 'MAX' ), true, 'returns expected value' );
+ t.strictEqual( pcg32.MAX, UINT32_MAX, 'returns expected value' );
+ t.throws( foo, Error, 'throws an error' );
+ t.end();
+
+ function foo() {
+ pcg32.MAX = 2;
+ }
+});
+
+tape( 'attached to the main export is a read-only `seed` property', function test( t ) {
+ t.strictEqual( hasOwnProp( pcg32, 'seed' ), true, 'returns expected value' );
+ t.strictEqual( isUint32Array( pcg32.seed ), true, 'returns expected value' );
+ t.throws( foo, Error, 'throws an error' );
+ t.end();
+
+ function foo() {
+ pcg32.seed = new Uint32Array( 1 );
+ }
+});
+
+tape( 'attached to the main export is a read-only `seedLength` property', function test( t ) {
+ t.strictEqual( hasOwnProp( pcg32, 'seedLength' ), true, 'returns expected value' );
+ t.strictEqual( isPositiveInteger( pcg32.seedLength ), true, 'returns expected value' );
+ t.throws( foo, Error, 'throws an error' );
+ t.end();
+
+ function foo() {
+ pcg32.seedLength = 2;
+ }
+});
+
+tape( 'attached to the main export is a `state` property', function test( t ) {
+ t.strictEqual( hasOwnProp( pcg32, 'state' ), true, 'returns expected value' );
+ t.strictEqual( isUint32Array( pcg32.state ), true, 'returns expected value' );
+ t.end();
+});
+
+tape( 'attached to the main export is a read-only `stateLength` property', function test( t ) {
+ t.strictEqual( hasOwnProp( pcg32, 'stateLength' ), true, 'returns expected value' );
+ t.strictEqual( isPositiveInteger( pcg32.stateLength ), true, 'returns expected value' );
+ t.throws( foo, Error, 'throws an error' );
+ t.end();
+
+ function foo() {
+ pcg32.stateLength = 1;
+ }
+});
+
+tape( 'attached to the main export is a read-only `byteLength` property', function test( t ) {
+ t.strictEqual( hasOwnProp( pcg32, 'byteLength' ), true, 'returns expected value' );
+ t.strictEqual( isPositiveInteger( pcg32.byteLength ), true, 'returns expected value' );
+ t.throws( foo, Error, 'throws an error' );
+ t.end();
+
+ function foo() {
+ pcg32.byteLength = 1;
+ }
+});
+
+tape( 'the function returns pseudorandom integers strictly between 0 and 2^32-1 (inclusive)', function test( t ) {
+ var v;
+ var i;
+ for ( i = 0; i < 1e3; i++ ) {
+ v = pcg32();
+ t.strictEqual( isInteger( v ), true, 'returns expected value' );
+ t.strictEqual( isBetween( v, 0, UINT32_MAX ), true, 'returns expected value' );
+ }
+ t.end();
+});
+
+tape( 'the `normalized` method returns pseudorandom numbers strictly between 0 (inclusive) and 1 (exclusive)', function test( t ) {
+ var v;
+ var i;
+ for ( i = 0; i < 1e3; i++ ) {
+ v = pcg32.normalized();
+ t.strictEqual( isNumber( v ), true, 'returns expected value' );
+ t.strictEqual( isBetween( v, 0.0, 1.0, 'closed', 'open' ), true, 'returns expected value' );
+ }
+ t.end();
+});
+
+tape( 'attached to the `normalized` method is a read-only `NAME` property', function test( t ) {
+ t.strictEqual( hasOwnProp( pcg32.normalized, 'NAME' ), true, 'returns expected value' );
+ t.strictEqual( pcg32.normalized.NAME, 'pcg32', 'returns expected value' );
+ t.throws( foo, Error, 'throws an error' );
+ t.end();
+
+ function foo() {
+ pcg32.normalized.NAME = 'foo';
+ }
+});
+
+tape( 'attached to the `normalized` method is a read-only `MIN` property', function test( t ) {
+ t.strictEqual( hasOwnProp( pcg32.normalized, 'MIN' ), true, 'returns expected value' );
+ t.strictEqual( pcg32.normalized.MIN, 0.0, 'returns expected value' );
+ t.throws( foo, Error, 'throws an error' );
+ t.end();
+
+ function foo() {
+ pcg32.normalized.MIN = 1;
+ }
+});
+
+tape( 'attached to the `normalized` method is a read-only `MAX` property', function test( t ) {
+ t.strictEqual( hasOwnProp( pcg32.normalized, 'MAX' ), true, 'returns expected value' );
+ t.strictEqual( pcg32.normalized.MAX, UINT32_MAX / ( UINT32_MAX + 1.0 ), 'returns expected value' );
+ t.throws( foo, Error, 'throws an error' );
+ t.end();
+
+ function foo() {
+ pcg32.normalized.MAX = 2;
+ }
+});
+
+tape( 'attached to the `normalized` method is a read-only `seed` property', function test( t ) {
+ t.strictEqual( hasOwnProp( pcg32.normalized, 'seed' ), true, 'returns expected value' );
+ t.strictEqual( isUint32Array( pcg32.normalized.seed ), true, 'returns expected value' );
+ t.throws( foo, Error, 'throws an error' );
+ t.end();
+
+ function foo() {
+ pcg32.normalized.seed = new Uint32Array( 1 );
+ }
+});
+
+tape( 'attached to the `normalized` method is a read-only `seedLength` property', function test( t ) {
+ t.strictEqual( hasOwnProp( pcg32.normalized, 'seedLength' ), true, 'returns expected value' );
+ t.strictEqual( isPositiveInteger( pcg32.normalized.seedLength ), true, 'returns expected value' );
+ t.throws( foo, Error, 'throws an error' );
+ t.end();
+
+ function foo() {
+ pcg32.normalized.seedLength = 1;
+ }
+});
+
+tape( 'attached to the `normalized` method is a `state` property', function test( t ) {
+ t.strictEqual( hasOwnProp( pcg32.normalized, 'state' ), true, 'returns expected value' );
+ t.strictEqual( isUint32Array( pcg32.normalized.state ), true, 'returns expected value' );
+ t.end();
+});
+
+tape( 'attached to the `normalized` method is a read-only `stateLength` property', function test( t ) {
+ t.strictEqual( hasOwnProp( pcg32.normalized, 'stateLength' ), true, 'returns expected value' );
+ t.strictEqual( isPositiveInteger( pcg32.normalized.stateLength ), true, 'returns expected value' );
+ t.throws( foo, Error, 'throws an error' );
+ t.end();
+
+ function foo() {
+ pcg32.normalized.stateLength = 1;
+ }
+});
+
+tape( 'attached to the `normalized` method is a read-only `byteLength` property', function test( t ) {
+ t.strictEqual( hasOwnProp( pcg32.normalized, 'byteLength' ), true, 'returns expected value' );
+ t.strictEqual( isPositiveInteger( pcg32.normalized.byteLength ), true, 'returns expected value' );
+ t.throws( foo, Error, 'throws an error' );
+ t.end();
+
+ function foo() {
+ pcg32.normalized.byteLength = 1;
+ }
+});
+
+tape( 'attached to the `normalized` method is a `toJSON` method', function test( t ) {
+ t.strictEqual( isMethod( pcg32.normalized, 'toJSON' ), true, 'returns expected value' );
+ t.end();
+});
+
+tape( 'the generator supports setting the generator state', function test( t ) {
+ var state;
+ var arr;
+ var i;
+
+ // Move to a future state...
+ for ( i = 0; i < 100; i++ ) {
+ pcg32();
+ }
+ // Capture the current state:
+ state = pcg32.state;
+
+ // Move to a future state...
+ arr = [];
+ for ( i = 0; i < 100; i++ ) {
+ arr.push( pcg32() );
+ }
+ // Set the state:
+ pcg32.state = state;
+
+ // Replay previously generated values...
+ for ( i = 0; i < 100; i++ ) {
+ t.strictEqual( pcg32(), arr[ i ], 'returns expected value' );
+ }
+ t.end();
+});
+
+tape( 'the generator supports setting the generator state (normalized)', function test( t ) {
+ var state;
+ var arr;
+ var i;
+
+ // Move to a future state...
+ for ( i = 0; i < 100; i++ ) {
+ pcg32.normalized();
+ }
+ // Capture the current state:
+ state = pcg32.state;
+
+ // Move to a future state...
+ arr = [];
+ for ( i = 0; i < 100; i++ ) {
+ arr.push( pcg32.normalized() );
+ }
+ // Set the state:
+ pcg32.state = state;
+
+ // Replay previously generated values...
+ for ( i = 0; i < 100; i++ ) {
+ t.strictEqual( pcg32.normalized(), arr[ i ], 'returns expected value' );
+ }
+ t.end();
+});
+
+tape( 'the generator supports setting the generator state (normalized)', function test( t ) {
+ var state;
+ var arr;
+ var i;
+
+ // Move to a future state...
+ for ( i = 0; i < 100; i++ ) {
+ pcg32.normalized();
+ }
+ // Capture the current state:
+ state = pcg32.normalized.state;
+
+ // Move to a future state...
+ arr = [];
+ for ( i = 0; i < 100; i++ ) {
+ arr.push( pcg32.normalized() );
+ }
+ // Set the state:
+ pcg32.normalized.state = state;
+
+ // Replay previously generated values...
+ for ( i = 0; i < 100; i++ ) {
+ t.strictEqual( pcg32.normalized(), arr[ i ], 'returns expected value' );
+ }
+ t.end();
+});
diff --git a/lib/node_modules/@stdlib/random/base/pcg32/test/test.native.js b/lib/node_modules/@stdlib/random/base/pcg32/test/test.native.js
new file mode 100644
index 000000000000..4e51baa017c2
--- /dev/null
+++ b/lib/node_modules/@stdlib/random/base/pcg32/test/test.native.js
@@ -0,0 +1,114 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2026 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+'use strict';
+
+// MODULES //
+
+var resolve = require( 'path' ).resolve;
+var tape = require( 'tape' );
+var tryRequire = require( '@stdlib/utils/try-require' );
+
+
+// FIXTURES //
+
+var UINT32_INTEGER_SEED = require( './fixtures/uint32_integer_seed.json' );
+var UINT32_ARRAY_SEED = require( './fixtures/uint32_array_seed.json' );
+var FLOAT64_INTEGER_SEED = require( './fixtures/float64_integer_seed.json' );
+var FLOAT64_ARRAY_SEED = require( './fixtures/float64_array_seed.json' );
+
+
+// VARIABLES //
+
+var native = tryRequire( resolve( __dirname, './../lib/native.js' ) );
+var opts = {
+ 'skip': ( native instanceof Error )
+};
+
+
+// TESTS //
+
+tape( 'main export is a function', opts, function test( t ) {
+ t.ok( true, __filename );
+ t.strictEqual( typeof native, 'function', 'main export is a function' );
+ t.end();
+});
+
+tape( 'the function returns expected pseudorandom integers (integer seed)', opts, function test( t ) {
+ var expected;
+ var actual;
+ var i;
+
+ expected = UINT32_INTEGER_SEED.expected;
+ actual = native( UINT32_INTEGER_SEED.seed, expected.length );
+
+ t.strictEqual( actual.length, expected.length, 'returns expected length' );
+ for ( i = 0; i < expected.length; i++ ) {
+ t.strictEqual( actual[ i ], expected[ i ], 'returns expected value' );
+ }
+ t.end();
+});
+
+tape( 'the function returns expected pseudorandom integers (array seed)', opts, function test( t ) {
+ var expected;
+ var actual;
+ var seed;
+ var i;
+
+ expected = UINT32_ARRAY_SEED.expected;
+ seed = UINT32_ARRAY_SEED.seed;
+ actual = native( seed, expected.length );
+
+ t.strictEqual( actual.length, expected.length, 'returns expected length' );
+ for ( i = 0; i < expected.length; i++ ) {
+ t.strictEqual( actual[ i ], expected[ i ], 'returns expected value' );
+ }
+ t.end();
+});
+
+tape( 'the `normalized` method returns expected pseudorandom numbers (integer seed)', opts, function test( t ) {
+ var expected;
+ var actual;
+ var i;
+
+ expected = FLOAT64_INTEGER_SEED.expected;
+ actual = native.normalized( FLOAT64_INTEGER_SEED.seed, expected.length );
+
+ t.strictEqual( actual.length, expected.length, 'returns expected length' );
+ for ( i = 0; i < expected.length; i++ ) {
+ t.strictEqual( actual[ i ], expected[ i ], 'returns expected value' );
+ }
+ t.end();
+});
+
+tape( 'the `normalized` method returns expected pseudorandom numbers (array seed)', opts, function test( t ) {
+ var expected;
+ var actual;
+ var seed;
+ var i;
+
+ expected = FLOAT64_ARRAY_SEED.expected;
+ seed = FLOAT64_ARRAY_SEED.seed;
+ actual = native.normalized( seed, expected.length );
+
+ t.strictEqual( actual.length, expected.length, 'returns expected length' );
+ for ( i = 0; i < expected.length; i++ ) {
+ t.strictEqual( actual[ i ], expected[ i ], 'returns expected value' );
+ }
+ t.end();
+});
diff --git a/lib/node_modules/@stdlib/types/index.d.ts b/lib/node_modules/@stdlib/types/index.d.ts
index 10f2f8490b7e..2289e93dc3ca 100644
--- a/lib/node_modules/@stdlib/types/index.d.ts
+++ b/lib/node_modules/@stdlib/types/index.d.ts
@@ -6226,6 +6226,25 @@ declare module '@stdlib/types/random' {
* const s: PRNGStateMINSTD = new Int32Array( 6 );
*/
type PRNGStateMINSTD = Int32Array;
+
+ /**
+ * A pseudorandom number generator (PRNG) seed for the 32-bit PCG PRNG.
+ *
+ * @example
+ * const s: PRNGSeedPCG32 = 12345;
+ *
+ * @example
+ * const s: PRNGSeedPCG32 = [ 12345, 67891 ];
+ */
+ type PRNGSeedPCG32 = number | ArrayLike;
+
+ /**
+ * A pseudorandom number generator (PRNG) state for the 32-bit PCG PRNG.
+ *
+ * @example
+ * const s: PRNGStatePCG32 = new Uint32Array( 7 );
+ */
+ type PRNGStatePCG32 = Uint32Array;
}
/**
diff --git a/lib/node_modules/@stdlib/types/test.ts b/lib/node_modules/@stdlib/types/test.ts
index 4b75f17b47cf..64154dd19772 100644
--- a/lib/node_modules/@stdlib/types/test.ts
+++ b/lib/node_modules/@stdlib/types/test.ts
@@ -690,6 +690,22 @@ function cmplx128Array(): array.Complex128Array {
if ( s6[ 0 ] !== 0 ) {
throw new Error( 'something went wrong' );
}
+
+ const s10: random.PRNGSeedPCG32 = 12345;
+ if ( s10 !== 12345 ) {
+ throw new Error( 'something went wrong' );
+ }
+
+ const s11: random.PRNGSeedPCG32 = new Uint32Array( 10 );
+ if ( s11[ 0 ] !== 0 ) {
+ throw new Error( 'something went wrong' );
+ }
+
+ const s12: random.PRNGStatePCG32 = new Uint32Array( 10 );
+ if ( s12[ 0 ] !== 0 ) {
+ throw new Error( 'something went wrong' );
+ }
+
}
// The compiler should not throw an error when using slice types...
diff --git a/tools/docs/jsdoc/typedefs/random.js b/tools/docs/jsdoc/typedefs/random.js
index da50cb78be3f..703fc37d983d 100644
--- a/tools/docs/jsdoc/typedefs/random.js
+++ b/tools/docs/jsdoc/typedefs/random.js
@@ -45,3 +45,15 @@
*
* @type {Int32Array} PRNGStateMINSTD
*/
+
+/**
+* A pseudorandom number generator (PRNG) seed for the 32-bit PCG PRNG.
+*
+* @type {(uinteger32|Collection)} PRNGSeedPCG32
+*/
+
+/**
+* A pseudorandom number generator (PRNG) state for the 32-bit PCG PRNG.
+*
+* @type {Uint32Array} PRNGStatePCG32
+*/