Roll: Difference between revisions

Jump to navigation Jump to search
76 bytes added ,  14:28, 14 July 2020
m
Text replacement - "http://help.dyalog.com" to "https://help.dyalog.com"
m (Text replacement - "http://help.dyalog.com" to "https://help.dyalog.com")
Tags: Mobile edit Mobile web edit
(One intermediate revision by the same user not shown)
Line 1: Line 1:
{{Built-in|Roll|?}} is a [[monadic]] [[scalar function]] which returns random or pseudo-random numbers. The name ''Roll'' comes from the analogy of rolling dice. Each [[scalar]] in the argument must be a positive integer, <source lang=apl inline>n</source>, and Roll chooses one of the first <source lang=apl inline>n</source> [[Index|indices]]. Some dialects allow <source lang=apl inline>n</source> to be zero, in which case Roll chooses a floating-point number between 0 and 1.
{{Built-in|Roll|?}} is a [[monadic]] [[scalar function]] which returns random or pseudo-random numbers. The name ''Roll'' comes from the analogy of rolling dice. Each [[scalar]] in the argument must be a positive integer, <source lang=apl inline>n</source>, and Roll chooses one of the first <source lang=apl inline>n</source> [[Index|indices]]. Some dialects allow <source lang=apl inline>n</source> to be zero, in which case Roll chooses a floating-point number between 0 and 1. Roll shares its [[glyph]] with the other random-result function, [[Deal]].


== Examples ==
== Examples ==
Line 35: Line 35:
=== Documentation ===
=== Documentation ===


* [http://help.dyalog.com/latest/index.htm#Language/Primitive%20Functions/Roll.htm Dyalog]
* [https://help.dyalog.com/latest/index.htm#Language/Primitive%20Functions/Roll.htm Dyalog]


* [http://microapl.com/apl_help/ch_020_020_170.htm APLX]
* [http://microapl.com/apl_help/ch_020_020_170.htm APLX]

Navigation menu