@thi.ng/random 3.6.4 → 3.6.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2023-08-31T10:05:26Z
3
+ - **Last updated**: 2023-10-05T11:44:15Z
4
4
  - **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
5
5
 
6
6
  All notable changes to this project will be documented in this file.
@@ -9,6 +9,13 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
9
9
  **Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
10
10
  and/or version bumps of transitive dependencies.
11
11
 
12
+ ### [3.6.6](https://github.com/thi-ng/umbrella/tree/@thi.ng/random@3.6.6) (2023-10-05)
13
+
14
+ #### 🩹 Bug fixes
15
+
16
+ - update ARandom.minmaxInt/Uint() ([33c35b4](https://github.com/thi-ng/umbrella/commit/33c35b4))
17
+ - fix NaN bug iff min == max
18
+
12
19
  ### [3.6.1](https://github.com/thi-ng/umbrella/tree/@thi.ng/random@3.6.1) (2023-08-12)
13
20
 
14
21
  #### ⏱ Performance improvements
package/README.md CHANGED
@@ -94,7 +94,7 @@ For Node.js REPL:
94
94
  const random = await import("@thi.ng/random");
95
95
  ```
96
96
 
97
- Package sizes (brotli'd, pre-treeshake): ESM: 1.87 KB
97
+ Package sizes (brotli'd, pre-treeshake): ESM: 1.88 KB
98
98
 
99
99
  ## Dependencies
100
100
 
@@ -119,7 +119,9 @@ A selection:
119
119
  | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/ifs-fractal.jpg" width="240"/> | Barnsley fern IFS fractal renderer | [Demo](https://demo.thi.ng/umbrella/ifs-fractal/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/ifs-fractal) |
120
120
  | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/kmeans-viz.jpg" width="240"/> | k-means clustering visualization | [Demo](https://demo.thi.ng/umbrella/kmeans-viz/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/kmeans-viz) |
121
121
  | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/pixel-sorting.png" width="240"/> | Interactive pixel sorting tool using thi.ng/color & thi.ng/pixel | [Demo](https://demo.thi.ng/umbrella/pixel-sorting/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/pixel-sorting) |
122
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/render-audio.png" width="240"/> | Generative audio synth offline renderer and WAV file export | [Demo](https://demo.thi.ng/umbrella/render-audio/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/render-audio) |
122
123
  | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/shader-ast-evo.jpg" width="240"/> | Evolutionary shader generation using genetic programming | [Demo](https://demo.thi.ng/umbrella/shader-ast-evo/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/shader-ast-evo) |
124
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/stacked-layout.png" width="240"/> | Responsive & reactively computed stacked column layout | [Demo](https://demo.thi.ng/umbrella/stacked-layout/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/stacked-layout) |
123
125
  | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/webgl-game-of-life.png" width="240"/> | Game of Life implemented as WebGL2 multi-pass shader pipeline | [Demo](https://demo.thi.ng/umbrella/webgl-game-of-life/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/webgl-game-of-life) |
124
126
 
125
127
  ## API
package/arandom.js CHANGED
@@ -18,10 +18,12 @@ export class ARandom {
18
18
  }
19
19
  minmaxInt(min, max) {
20
20
  min |= 0;
21
- return min + (this.int() % ((max | 0) - min));
21
+ const range = (max | 0) - min;
22
+ return range ? min + (this.int() % range) : min;
22
23
  }
23
24
  minmaxUint(min, max) {
24
25
  min >>>= 0;
25
- return min + (this.int() % ((max >>> 0) - min));
26
+ const range = (max >>> 0) - min;
27
+ return range ? min + (this.int() % range) : min;
26
28
  }
27
29
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/random",
3
- "version": "3.6.4",
3
+ "version": "3.6.6",
4
4
  "description": "Pseudo-random number generators w/ unified API, distributions, weighted choices, ID generation",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -156,5 +156,5 @@
156
156
  "ksuid"
157
157
  ]
158
158
  },
159
- "gitHead": "34c3bd36b0133af05abc7fe66affa01dd99704ac\n"
159
+ "gitHead": "10d8b3725e96c5d704c759489a89f132892b181e\n"
160
160
  }