Difference between revisions of "Rn1"
Jump to navigation
Jump to search
(Added hatnote: "Not to be confused with rnl") |
m ({{distinguish}} for hatnote) |
||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:rn1}} | {{DISPLAYTITLE:rn1}} | ||
{{randomvariable|name=rn1(<var>x</var>,<var>y</var>)|graph=rn1.svg|caption=[[wikipedia:Probability mass function|Probability mass function]] of rn1(10,5)|distribution=[[Wikipedia:discrete uniform distribution|uniform]]|mean={{sfrac|<var>x</var> − 1|2}} + <var>y</var>|stddev=sqrt({{sfrac|x<sup>2</sup> − 1|12}})}} | {{randomvariable|name=rn1(<var>x</var>,<var>y</var>)|graph=rn1.svg|caption=[[wikipedia:Probability mass function|Probability mass function]] of rn1(10,5)|distribution=[[Wikipedia:discrete uniform distribution|uniform]]|mean={{sfrac|<var>x</var> − 1|2}} + <var>y</var>|stddev=sqrt({{sfrac|x<sup>2</sup> − 1|12}})}} | ||
− | + | {{distinguish|rnl}} | |
'''rn1(<var>x</var>, <var>y</var>)'''{{refsrc|hack.h|291}} is a pseudo-random number macro used in ''NetHack'' when a result should be unweighted. It is equivalent to rn2(<var>x</var>) + <var>y</var>. The range of values is between <var>y</var> and <var>y</var> + <var>x</var> − 1 inclusive (that is, <var>y</var> ≤ rn1(<var>x</var>,<var>y</var>) < <var>x</var> + <var>y</var>). | '''rn1(<var>x</var>, <var>y</var>)'''{{refsrc|hack.h|291}} is a pseudo-random number macro used in ''NetHack'' when a result should be unweighted. It is equivalent to rn2(<var>x</var>) + <var>y</var>. The range of values is between <var>y</var> and <var>y</var> + <var>x</var> − 1 inclusive (that is, <var>y</var> ≤ rn1(<var>x</var>,<var>y</var>) < <var>x</var> + <var>y</var>). | ||
Revision as of 04:35, 28 January 2020
rn1(x,y) | |
---|---|
Distribution | uniform |
Mean | x − 12 + y |
Standard deviation | sqrt(x2 − 112) |
- Not to be confused with rnl.
rn1(x, y)[1] is a pseudo-random number macro used in NetHack when a result should be unweighted. It is equivalent to rn2(x) + y. The range of values is between y and y + x − 1 inclusive (that is, y ≤ rn1(x,y) < x + y).
See also rn2.
References
- This page is a stub. Should you wish to do so, you can contribute by expanding this page.
This page may need to be updated for the current version of NetHack.
It may contain text specific to NetHack 3.4.3. Information on this page may be out of date.
Editors: After reviewing this page and making necessary edits, please change the {{nethack-343}} tag to the current version's tag or {{noversion}} as appropriate.