Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
13 | reyssat | 1 | <p> |
2 | For example, if you want to generate a random decimal number with 2 digits after the decimal point and within the range [-10:10], you may first generate a random integer within the range [-1000:1000], then divide the result by 100. For example under OEF format, this can be done by |
||
3 | <pre> |
||
4 | \\real{r=randint(-1000..1000)/100} |
||
5 | </pre> |
||
6 | Test its result: |
||
7 | \def{real r=randint(-1000..1000)/100} \r [\reload{Refresh}{randdec}] |