Returns a readable stream for generating a stream of pseudorandom numbers drawn from a standard normal distribution using the Box-Muller transform.
stream options
stream instance
var inspectStream = require( `@stdlib/streams/node/inspect-sink` );
function log( chunk ) {
console.log( chunk.toString() );
}
var opts = {
'iter': 10
};
var stream = new RandomStream( opts );
stream.pipe( inspectStream( log ) );
Underlying PRNG.
PRNG state size (in bytes).
PRNG seed.
PRNG seed length.
PRNG state.
PRNG state length.
Implements the _read
method.
number (of bytes) to read
Event emitter The defined events on documents including:
Gracefully destroys a stream, providing backward compatibility.
error
var stream = new RandomStream();
stream.on( 'error', onError );
function onError( err ) {
stream.destroy( err );
}
A utility method for creating Readable Streams out of iterators.
Class for creating readable streams which generate a stream of pseudorandom numbers drawn from a standard normal distribution using the Box-Muller transform.