Skip to content

Commit 7c8a587

Browse files
committed
Add separate state length property
1 parent 01b27b6 commit 7c8a587

File tree

5 files changed

+31
-2
lines changed

5 files changed

+31
-2
lines changed

lib/node_modules/@stdlib/random/base/arcsine/README.md

+10-1
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,18 @@ r = arcsine( 2.0, 4.0 );
190190
// ...
191191
```
192192

193+
#### arcsine.STATE_LENGTH
194+
195+
Length of generator state.
196+
197+
```javascript
198+
var len = arcsine.STATE_LENGTH;
199+
// returns <number>
200+
```
201+
193202
#### arcsine.STATE_SIZE
194203

195-
Size of generator state.
204+
Size (in bytes) of generator state.
196205

197206
```javascript
198207
var sz = arcsine.STATE_SIZE;

lib/node_modules/@stdlib/random/base/arcsine/docs/repl.txt

+9-1
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,16 @@
127127
<number>
128128

129129

130+
{{alias}}.STATE_LENGTH
131+
Length of generator state.
132+
133+
Examples
134+
--------
135+
> var len = {{alias}}.STATE_LENGTH;
136+
137+
130138
{{alias}}.STATE_SIZE
131-
Size of generator state.
139+
Size (in bytes) of generator state.
132140

133141
Examples
134142
--------

lib/node_modules/@stdlib/random/base/arcsine/lib/factory.js

+1
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ function factory() {
105105
'get': getState,
106106
'set': setState
107107
});
108+
setReadOnly( prng, 'STATE_LENGTH', rand.STATE_LENGTH );
108109
setReadOnly( prng, 'STATE_SIZE', rand.STATE_SIZE );
109110
setReadOnly( prng, 'PRNG', rand );
110111

lib/node_modules/@stdlib/random/base/arcsine/test/test.factory.js

+6
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,12 @@ tape( 'attached to the returned function is the generator state', function test(
119119
t.end();
120120
});
121121

122+
tape( 'attached to the returned function is the generator state length', function test( t ) {
123+
var arcsine = factory();
124+
t.equal( typeof arcsine.STATE_LENGTH, 'number', 'has `STATE_LENGTH` property' );
125+
t.end();
126+
});
127+
122128
tape( 'attached to the returned function is the generator state size', function test( t ) {
123129
var arcsine = factory();
124130
t.equal( typeof arcsine.STATE_SIZE, 'number', 'has `STATE_SIZE` property' );

lib/node_modules/@stdlib/random/base/arcsine/test/test.js

+5
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ tape( 'attached to the main export is the generator state', function test( t ) {
5858
t.end();
5959
});
6060

61+
tape( 'attached to the main export is the generator state length', function test( t ) {
62+
t.equal( typeof arcsine.STATE_LENGTH, 'number', 'has `STATE_LENGTH` property' );
63+
t.end();
64+
});
65+
6166
tape( 'attached to the main export is the generator state size', function test( t ) {
6267
t.equal( typeof arcsine.STATE_SIZE, 'number', 'has `STATE_SIZE` property' );
6368
t.end();

0 commit comments

Comments
 (0)