Open oscbyspro opened 1 month ago
Hm. I suppose there are arguments in favor of keeping the trapping behavior. In particular, picking a random value in an infinite range a lot like multiplying an arbitrary integer until you run out of memory. It isn't undefined. You just run out of memory, or at least that's what the trapping behavior emulates. It might be best to keep overallocation handling, or lack thereof, consistent across the board.
The range-based
BinaryInteger.random(...)
functions trap infinite ranges. It would be better to returnnil
. The current functions should be rewritten as unchecked conveniences with appropriate generic constraints.