/usr/share/doc/libjuce/apiref/classRandom.html is in libjuce-doc 4.3.0~repack-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.12"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>JUCE: Random Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">JUCE
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.12 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> |
<a href="#pub-static-methods">Static Public Member Functions</a> |
<a href="classRandom-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">Random Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>A random number generator.
<a href="classRandom.html#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a510ef17add8a962faf696cf0f434d8f8"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classRandom.html#a510ef17add8a962faf696cf0f434d8f8">Random</a> (<a class="el" href="juce__MathsFunctions_8h.html#aecfc3c54bd29ad5964e1c1c3ccbf89df">int64</a> seedValue) noexcept</td></tr>
<tr class="memdesc:a510ef17add8a962faf696cf0f434d8f8"><td class="mdescLeft"> </td><td class="mdescRight">Creates a <a class="el" href="classRandom.html" title="A random number generator. ">Random</a> object based on a seed value. <a href="#a510ef17add8a962faf696cf0f434d8f8">More...</a><br /></td></tr>
<tr class="separator:a510ef17add8a962faf696cf0f434d8f8"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:acb76b49c3903a3c4fb67fd216341f08d"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classRandom.html#acb76b49c3903a3c4fb67fd216341f08d">Random</a> ()</td></tr>
<tr class="memdesc:acb76b49c3903a3c4fb67fd216341f08d"><td class="mdescLeft"> </td><td class="mdescRight">Creates a <a class="el" href="classRandom.html" title="A random number generator. ">Random</a> object using a random seed value. <a href="#acb76b49c3903a3c4fb67fd216341f08d">More...</a><br /></td></tr>
<tr class="separator:acb76b49c3903a3c4fb67fd216341f08d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a98b1bf7fbd8c122c08c9f35b9e603923"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classRandom.html#a98b1bf7fbd8c122c08c9f35b9e603923">~Random</a> () noexcept</td></tr>
<tr class="memdesc:a98b1bf7fbd8c122c08c9f35b9e603923"><td class="mdescLeft"> </td><td class="mdescRight">Destructor. <a href="#a98b1bf7fbd8c122c08c9f35b9e603923">More...</a><br /></td></tr>
<tr class="separator:a98b1bf7fbd8c122c08c9f35b9e603923"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a69dd2014564478eb13ca41c03679c8f9"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classRandom.html#a69dd2014564478eb13ca41c03679c8f9">nextInt</a> () noexcept</td></tr>
<tr class="memdesc:a69dd2014564478eb13ca41c03679c8f9"><td class="mdescLeft"> </td><td class="mdescRight">Returns the next random 32 bit integer. <a href="#a69dd2014564478eb13ca41c03679c8f9">More...</a><br /></td></tr>
<tr class="separator:a69dd2014564478eb13ca41c03679c8f9"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a6ba948a9d1935253f9770d848f57412f"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classRandom.html#a6ba948a9d1935253f9770d848f57412f">nextInt</a> (int maxValue) noexcept</td></tr>
<tr class="memdesc:a6ba948a9d1935253f9770d848f57412f"><td class="mdescLeft"> </td><td class="mdescRight">Returns the next random number, limited to a given range. <a href="#a6ba948a9d1935253f9770d848f57412f">More...</a><br /></td></tr>
<tr class="separator:a6ba948a9d1935253f9770d848f57412f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:abc9ff9c9678c94c54dcfb9e6f040b64c"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classRandom.html#abc9ff9c9678c94c54dcfb9e6f040b64c">nextInt</a> (<a class="el" href="classRange.html">Range</a>< int > range) noexcept</td></tr>
<tr class="memdesc:abc9ff9c9678c94c54dcfb9e6f040b64c"><td class="mdescLeft"> </td><td class="mdescRight">Returns the next random number, limited to a given range. <a href="#abc9ff9c9678c94c54dcfb9e6f040b64c">More...</a><br /></td></tr>
<tr class="separator:abc9ff9c9678c94c54dcfb9e6f040b64c"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aa78fa923adb76a168c5c67d072cfcef3"><td class="memItemLeft" align="right" valign="top"><a class="el" href="juce__MathsFunctions_8h.html#aecfc3c54bd29ad5964e1c1c3ccbf89df">int64</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classRandom.html#aa78fa923adb76a168c5c67d072cfcef3">nextInt64</a> () noexcept</td></tr>
<tr class="memdesc:aa78fa923adb76a168c5c67d072cfcef3"><td class="mdescLeft"> </td><td class="mdescRight">Returns the next 64-bit random number. <a href="#aa78fa923adb76a168c5c67d072cfcef3">More...</a><br /></td></tr>
<tr class="separator:aa78fa923adb76a168c5c67d072cfcef3"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aec88d4e5cf44faaa038f6cfb41e96406"><td class="memItemLeft" align="right" valign="top">float </td><td class="memItemRight" valign="bottom"><a class="el" href="classRandom.html#aec88d4e5cf44faaa038f6cfb41e96406">nextFloat</a> () noexcept</td></tr>
<tr class="memdesc:aec88d4e5cf44faaa038f6cfb41e96406"><td class="mdescLeft"> </td><td class="mdescRight">Returns the next random floating-point number. <a href="#aec88d4e5cf44faaa038f6cfb41e96406">More...</a><br /></td></tr>
<tr class="separator:aec88d4e5cf44faaa038f6cfb41e96406"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a764eba8fe3386554268f395ff1c4e7ea"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="classRandom.html#a764eba8fe3386554268f395ff1c4e7ea">nextDouble</a> () noexcept</td></tr>
<tr class="memdesc:a764eba8fe3386554268f395ff1c4e7ea"><td class="mdescLeft"> </td><td class="mdescRight">Returns the next random floating-point number. <a href="#a764eba8fe3386554268f395ff1c4e7ea">More...</a><br /></td></tr>
<tr class="separator:a764eba8fe3386554268f395ff1c4e7ea"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aa360f04c653725ec92b3173af338ed37"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classRandom.html#aa360f04c653725ec92b3173af338ed37">nextBool</a> () noexcept</td></tr>
<tr class="memdesc:aa360f04c653725ec92b3173af338ed37"><td class="mdescLeft"> </td><td class="mdescRight">Returns the next random boolean value. <a href="#aa360f04c653725ec92b3173af338ed37">More...</a><br /></td></tr>
<tr class="separator:aa360f04c653725ec92b3173af338ed37"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af9aacfc547bfcdba8aa2fa8f04022896"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classBigInteger.html">BigInteger</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classRandom.html#af9aacfc547bfcdba8aa2fa8f04022896">nextLargeNumber</a> (const <a class="el" href="classBigInteger.html">BigInteger</a> &maximumValue)</td></tr>
<tr class="memdesc:af9aacfc547bfcdba8aa2fa8f04022896"><td class="mdescLeft"> </td><td class="mdescRight">Returns a <a class="el" href="classBigInteger.html" title="An arbitrarily large integer class. ">BigInteger</a> containing a random number. <a href="#af9aacfc547bfcdba8aa2fa8f04022896">More...</a><br /></td></tr>
<tr class="separator:af9aacfc547bfcdba8aa2fa8f04022896"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a9730ae70ef775fc729b3f6c30ccd7ebc"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classRandom.html#a9730ae70ef775fc729b3f6c30ccd7ebc">fillBitsRandomly</a> (void *bufferToFill, size_t sizeInBytes)</td></tr>
<tr class="memdesc:a9730ae70ef775fc729b3f6c30ccd7ebc"><td class="mdescLeft"> </td><td class="mdescRight">Fills a block of memory with random values. <a href="#a9730ae70ef775fc729b3f6c30ccd7ebc">More...</a><br /></td></tr>
<tr class="separator:a9730ae70ef775fc729b3f6c30ccd7ebc"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a212bf60fe480e13ea468ba4db1de3329"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classRandom.html#a212bf60fe480e13ea468ba4db1de3329">fillBitsRandomly</a> (<a class="el" href="classBigInteger.html">BigInteger</a> &arrayToChange, int startBit, int numBits)</td></tr>
<tr class="memdesc:a212bf60fe480e13ea468ba4db1de3329"><td class="mdescLeft"> </td><td class="mdescRight">Sets a range of bits in a <a class="el" href="classBigInteger.html" title="An arbitrarily large integer class. ">BigInteger</a> to random values. <a href="#a212bf60fe480e13ea468ba4db1de3329">More...</a><br /></td></tr>
<tr class="separator:a212bf60fe480e13ea468ba4db1de3329"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a09bc3dbf46b852575593fa732dcbb824"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classRandom.html#a09bc3dbf46b852575593fa732dcbb824">setSeed</a> (<a class="el" href="juce__MathsFunctions_8h.html#aecfc3c54bd29ad5964e1c1c3ccbf89df">int64</a> newSeed) noexcept</td></tr>
<tr class="memdesc:a09bc3dbf46b852575593fa732dcbb824"><td class="mdescLeft"> </td><td class="mdescRight">Resets this <a class="el" href="classRandom.html" title="A random number generator. ">Random</a> object to a given seed value. <a href="#a09bc3dbf46b852575593fa732dcbb824">More...</a><br /></td></tr>
<tr class="separator:a09bc3dbf46b852575593fa732dcbb824"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a861cb0ae6a3d0387416b12c8efeabc9e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="juce__MathsFunctions_8h.html#aecfc3c54bd29ad5964e1c1c3ccbf89df">int64</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classRandom.html#a861cb0ae6a3d0387416b12c8efeabc9e">getSeed</a> () const noexcept</td></tr>
<tr class="memdesc:a861cb0ae6a3d0387416b12c8efeabc9e"><td class="mdescLeft"> </td><td class="mdescRight">Returns the RNG's current seed. <a href="#a861cb0ae6a3d0387416b12c8efeabc9e">More...</a><br /></td></tr>
<tr class="separator:a861cb0ae6a3d0387416b12c8efeabc9e"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af8a7c8f1f8aa96b761c441f34382cd4a"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classRandom.html#af8a7c8f1f8aa96b761c441f34382cd4a">combineSeed</a> (<a class="el" href="juce__MathsFunctions_8h.html#aecfc3c54bd29ad5964e1c1c3ccbf89df">int64</a> seedValue) noexcept</td></tr>
<tr class="memdesc:af8a7c8f1f8aa96b761c441f34382cd4a"><td class="mdescLeft"> </td><td class="mdescRight">Merges this object's seed with another value. <a href="#af8a7c8f1f8aa96b761c441f34382cd4a">More...</a><br /></td></tr>
<tr class="separator:af8a7c8f1f8aa96b761c441f34382cd4a"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a2b697677bd4fef05082e7c036366289d"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classRandom.html#a2b697677bd4fef05082e7c036366289d">setSeedRandomly</a> ()</td></tr>
<tr class="memdesc:a2b697677bd4fef05082e7c036366289d"><td class="mdescLeft"> </td><td class="mdescRight">Reseeds this generator using a value generated from various semi-random system properties like the current time, etc. <a href="#a2b697677bd4fef05082e7c036366289d">More...</a><br /></td></tr>
<tr class="separator:a2b697677bd4fef05082e7c036366289d"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:ab28f53c256fcd938cd86137c5c44c5fc"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classRandom.html">Random</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classRandom.html#ab28f53c256fcd938cd86137c5c44c5fc">getSystemRandom</a> () noexcept</td></tr>
<tr class="memdesc:ab28f53c256fcd938cd86137c5c44c5fc"><td class="mdescLeft"> </td><td class="mdescRight">The overhead of creating a new <a class="el" href="classRandom.html" title="A random number generator. ">Random</a> object is fairly small, but if you want to avoid it, you can call this method to get a global shared <a class="el" href="classRandom.html" title="A random number generator. ">Random</a> object. <a href="#ab28f53c256fcd938cd86137c5c44c5fc">More...</a><br /></td></tr>
<tr class="separator:ab28f53c256fcd938cd86137c5c44c5fc"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>A random number generator. </p>
<p>You can create a <a class="el" href="classRandom.html" title="A random number generator. ">Random</a> object and use it to generate a sequence of random numbers. </p>
</div><h2 class="groupheader">Constructor & Destructor Documentation</h2>
<a id="a510ef17add8a962faf696cf0f434d8f8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a510ef17add8a962faf696cf0f434d8f8">§ </a></span>Random() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">Random::Random </td>
<td>(</td>
<td class="paramtype"><a class="el" href="juce__MathsFunctions_8h.html#aecfc3c54bd29ad5964e1c1c3ccbf89df">int64</a> </td>
<td class="paramname"><em>seedValue</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">explicit</span><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Creates a <a class="el" href="classRandom.html" title="A random number generator. ">Random</a> object based on a seed value. </p>
<p>For a given seed value, the subsequent numbers generated by this object will be predictable, so a good idea is to set this value based on the time, e.g.</p>
<p>new <a class="el" href="classRandom.html" title="A random number generator. ">Random</a> (<a class="el" href="classTime.html#a3ddd01042580e201e78e92c46b5e5f54" title="Returns the current system time. ">Time::currentTimeMillis()</a>) </p>
</div>
</div>
<a id="acb76b49c3903a3c4fb67fd216341f08d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acb76b49c3903a3c4fb67fd216341f08d">§ </a></span>Random() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">Random::Random </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Creates a <a class="el" href="classRandom.html" title="A random number generator. ">Random</a> object using a random seed value. </p>
<p>Internally, this calls <a class="el" href="classRandom.html#a2b697677bd4fef05082e7c036366289d" title="Reseeds this generator using a value generated from various semi-random system properties like the cu...">setSeedRandomly()</a> to randomise the seed. </p>
</div>
</div>
<a id="a98b1bf7fbd8c122c08c9f35b9e603923"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a98b1bf7fbd8c122c08c9f35b9e603923">§ </a></span>~Random()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">Random::~Random </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Destructor. </p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a69dd2014564478eb13ca41c03679c8f9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a69dd2014564478eb13ca41c03679c8f9">§ </a></span>nextInt() <span class="overload">[1/3]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">int Random::nextInt </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the next random 32 bit integer. </p>
<dl class="section return"><dt>Returns</dt><dd>a random integer from the full range 0x80000000 to 0x7fffffff </dd></dl>
</div>
</div>
<a id="a6ba948a9d1935253f9770d848f57412f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6ba948a9d1935253f9770d848f57412f">§ </a></span>nextInt() <span class="overload">[2/3]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">int Random::nextInt </td>
<td>(</td>
<td class="paramtype">int </td>
<td class="paramname"><em>maxValue</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the next random number, limited to a given range. </p>
<p>The maxValue parameter may not be negative, or zero. </p><dl class="section return"><dt>Returns</dt><dd>a random integer between 0 (inclusive) and maxValue (exclusive). </dd></dl>
</div>
</div>
<a id="abc9ff9c9678c94c54dcfb9e6f040b64c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abc9ff9c9678c94c54dcfb9e6f040b64c">§ </a></span>nextInt() <span class="overload">[3/3]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">int Random::nextInt </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classRange.html">Range</a>< int > </td>
<td class="paramname"><em>range</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the next random number, limited to a given range. </p>
<dl class="section return"><dt>Returns</dt><dd>a random integer between the range start (inclusive) and its end (exclusive). </dd></dl>
</div>
</div>
<a id="aa78fa923adb76a168c5c67d072cfcef3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa78fa923adb76a168c5c67d072cfcef3">§ </a></span>nextInt64()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="juce__MathsFunctions_8h.html#aecfc3c54bd29ad5964e1c1c3ccbf89df">int64</a> Random::nextInt64 </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the next 64-bit random number. </p>
<dl class="section return"><dt>Returns</dt><dd>a random integer from the full range 0x8000000000000000 to 0x7fffffffffffffff </dd></dl>
</div>
</div>
<a id="aec88d4e5cf44faaa038f6cfb41e96406"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aec88d4e5cf44faaa038f6cfb41e96406">§ </a></span>nextFloat()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">float Random::nextFloat </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the next random floating-point number. </p>
<dl class="section return"><dt>Returns</dt><dd>a random value in the range 0 (inclusive) to 1.0 (exclusive) </dd></dl>
</div>
</div>
<a id="a764eba8fe3386554268f395ff1c4e7ea"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a764eba8fe3386554268f395ff1c4e7ea">§ </a></span>nextDouble()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">double Random::nextDouble </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the next random floating-point number. </p>
<dl class="section return"><dt>Returns</dt><dd>a random value in the range 0 (inclusive) to 1.0 (exclusive) </dd></dl>
</div>
</div>
<a id="aa360f04c653725ec92b3173af338ed37"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa360f04c653725ec92b3173af338ed37">§ </a></span>nextBool()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool Random::nextBool </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the next random boolean value. </p>
</div>
</div>
<a id="af9aacfc547bfcdba8aa2fa8f04022896"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af9aacfc547bfcdba8aa2fa8f04022896">§ </a></span>nextLargeNumber()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classBigInteger.html">BigInteger</a> Random::nextLargeNumber </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classBigInteger.html">BigInteger</a> & </td>
<td class="paramname"><em>maximumValue</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns a <a class="el" href="classBigInteger.html" title="An arbitrarily large integer class. ">BigInteger</a> containing a random number. </p>
<dl class="section return"><dt>Returns</dt><dd>a random value in the range 0 to (maximumValue - 1). </dd></dl>
</div>
</div>
<a id="a9730ae70ef775fc729b3f6c30ccd7ebc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9730ae70ef775fc729b3f6c30ccd7ebc">§ </a></span>fillBitsRandomly() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void Random::fillBitsRandomly </td>
<td>(</td>
<td class="paramtype">void * </td>
<td class="paramname"><em>bufferToFill</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>sizeInBytes</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Fills a block of memory with random values. </p>
</div>
</div>
<a id="a212bf60fe480e13ea468ba4db1de3329"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a212bf60fe480e13ea468ba4db1de3329">§ </a></span>fillBitsRandomly() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void Random::fillBitsRandomly </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classBigInteger.html">BigInteger</a> & </td>
<td class="paramname"><em>arrayToChange</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>startBit</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>numBits</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets a range of bits in a <a class="el" href="classBigInteger.html" title="An arbitrarily large integer class. ">BigInteger</a> to random values. </p>
</div>
</div>
<a id="a09bc3dbf46b852575593fa732dcbb824"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a09bc3dbf46b852575593fa732dcbb824">§ </a></span>setSeed()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void Random::setSeed </td>
<td>(</td>
<td class="paramtype"><a class="el" href="juce__MathsFunctions_8h.html#aecfc3c54bd29ad5964e1c1c3ccbf89df">int64</a> </td>
<td class="paramname"><em>newSeed</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Resets this <a class="el" href="classRandom.html" title="A random number generator. ">Random</a> object to a given seed value. </p>
</div>
</div>
<a id="a861cb0ae6a3d0387416b12c8efeabc9e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a861cb0ae6a3d0387416b12c8efeabc9e">§ </a></span>getSeed()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="juce__MathsFunctions_8h.html#aecfc3c54bd29ad5964e1c1c3ccbf89df">int64</a> Random::getSeed </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the RNG's current seed. </p>
<p>References <a class="el" href="juce__LeakedObjectDetector_8h.html#ab3639a79598b35f2116f4572af0d93f1">JUCE_LEAK_DETECTOR</a>.</p>
</div>
</div>
<a id="af8a7c8f1f8aa96b761c441f34382cd4a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af8a7c8f1f8aa96b761c441f34382cd4a">§ </a></span>combineSeed()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void Random::combineSeed </td>
<td>(</td>
<td class="paramtype"><a class="el" href="juce__MathsFunctions_8h.html#aecfc3c54bd29ad5964e1c1c3ccbf89df">int64</a> </td>
<td class="paramname"><em>seedValue</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Merges this object's seed with another value. </p>
<p>This sets the seed to be a value created by combining the current seed and this new value. </p>
</div>
</div>
<a id="a2b697677bd4fef05082e7c036366289d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2b697677bd4fef05082e7c036366289d">§ </a></span>setSeedRandomly()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void Random::setSeedRandomly </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Reseeds this generator using a value generated from various semi-random system properties like the current time, etc. </p>
<p>Because this function convolves the time with the last seed value, calling it repeatedly will increase the randomness of the final result. </p>
</div>
</div>
<a id="ab28f53c256fcd938cd86137c5c44c5fc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab28f53c256fcd938cd86137c5c44c5fc">§ </a></span>getSystemRandom()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static <a class="el" href="classRandom.html">Random</a>& Random::getSystemRandom </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>The overhead of creating a new <a class="el" href="classRandom.html" title="A random number generator. ">Random</a> object is fairly small, but if you want to avoid it, you can call this method to get a global shared <a class="el" href="classRandom.html" title="A random number generator. ">Random</a> object. </p>
<p>It's not thread-safe though, so threads should use their own <a class="el" href="classRandom.html" title="A random number generator. ">Random</a> object, otherwise you run the risk of your random numbers becoming.. erm.. randomly corrupted.. </p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="juce__Random_8h.html">juce_Random.h</a></li>
</ul>
</div><!-- contents -->
<hr class="footer"/>
<address class="footer"><small>All content © ROLI Ltd.</small></address><br/>
</body>
</html>
|