proposal: add support for ?0 to generate a random float between 0 and 1 #167
Closed
Description
Some APL dialects (including Dyalog APL and J) feature a unary roll operator that generates a random floating-point number between 0 and 1 when the operand is zero. See https://aplwiki.com/wiki/Roll
Example:
?0
0.945196149294
The revised doc text could be:
Roll ?B ? One integer selected randomly from the first B integers
If B=0, random floating-point number between 0 and 1
The implementation would return
BigFloat{big.NewFloat(c.Config().Random().Float64())}
Is this something you could imagine for Ivy as well? If so, I can create a pull request.
Metadata
Assignees
Labels
No labels