itertools-ts
itertools-ts copied to clipboard
Implement percentage functions for random number generation
- Added synchronous percentage() function to generate random percentages (0 to 1) with optional repetition.
- Implemented asynchronous percentageAsync() function to generate random percentages asynchronously with optional repetition.
- Created AsyncStream.percentage() to wrap percentageAsync() in an async stream.
- Added Stream.percentage() to wrap percentage() in a synchronous stream.
- Included error handling for negative repetitions using InvalidArgumentError.
These changes introduce support for both synchronous and asynchronous random percentage generation with flexible iteration options.