itertools-ts icon indicating copy to clipboard operation
itertools-ts copied to clipboard

Implement percentage functions for random number generation

Open Manya7547 opened this issue 7 months ago • 2 comments

  • 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.

Manya7547 avatar Mar 10 '25 01:03 Manya7547