https://wiki.tiplanet.org/index.php?title=TI-Basic/z80/maths/proba/rand&feed=atom&action=history TI-Basic/z80/maths/proba/rand - Historique des versions 2024-03-29T12:56:08Z Historique des versions pour cette page sur le wiki MediaWiki 1.40.0 https://wiki.tiplanet.org/index.php?title=TI-Basic/z80/maths/proba/rand&diff=3387&oldid=prev Persalteas le 25 juin 2014 à 12:55 2014-06-25T12:55:40Z <p></p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <col class="diff-marker" /> <col class="diff-content" /> <col class="diff-marker" /> <col class="diff-content" /> <tr class="diff-title" lang="fr"> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Version précédente</td> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Version du 25 juin 2014 à 13:55</td> </tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l55">Ligne 55 :</td> <td colspan="2" class="diff-lineno">Ligne 55 :</td></tr> <tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Voir aussi ==</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Voir aussi ==</div></td></tr> <tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [http://tibasicdev.wikidot.com/rand Sur TI-Basic Developer]</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [http://tibasicdev.wikidot.com/rand Sur TI-Basic Developer]</div></td></tr> <tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>* [[TI-Basic/z80/maths/<del style="font-weight: bold; text-decoration: none;">numeric</del>/randInt|randInt()]]</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>* [[TI-Basic/z80/maths/<ins style="font-weight: bold; text-decoration: none;">proba</ins>/randInt|randInt()]]</div></td></tr> <tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>* [[TI-Basic/z80/maths/<del style="font-weight: bold; text-decoration: none;">numeric</del>/randBin|randBin()]]</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>* [[TI-Basic/z80/maths/<ins style="font-weight: bold; text-decoration: none;">proba</ins>/randBin|randBin()]]</div></td></tr> <tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">* [[TI-Basic/z80/maths/numeric/randIntNoRep|randIntNoRep()]]</del></div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> </div></td></tr> <tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr> <tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr> <tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{TI-Basicz80}}</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{TI-Basicz80}}</div></td></tr> </table> Persalteas https://wiki.tiplanet.org/index.php?title=TI-Basic/z80/maths/proba/rand&diff=3385&oldid=prev Persalteas : Page créée avec « {{Infobox fonction |title = rand |name = rand |image = |caption = |modeles = TI-81 à TI-86 ''(tous)'' |acces = [math][gauche][enter] |poids = 1 octet }} == De... » 2014-06-25T12:36:51Z <p>Page créée avec « {{Infobox fonction |title = rand |name = rand |image = |caption = |modeles = <a href="/TI-81" title="TI-81">TI-81</a> à <a href="/TI-86" title="TI-86">TI-86</a> &#039;&#039;(tous)&#039;&#039; |acces = [math][gauche][enter] |poids = 1 octet }} == De... »</p> <p><b>Nouvelle page</b></p><div>{{Infobox fonction<br /> |title = rand<br /> |name = rand<br /> |image = <br /> |caption = <br /> |modeles = [[TI-81]] à [[TI-86]] ''(tous)''<br /> |acces = [math][gauche][enter]<br /> |poids = 1 octet<br /> }}<br /> <br /> == Description ==<br /> Cette renvoie un ou plusieurs nombres pseudo-aléatoires entre 0 et 1 exclus.<br /> <br /> Il est important de noter que, si 0 est '''toujours''' exclu, un nombre aléatoire peut avoir pour valeur maximale jusqu'à 1-1*10^(-12), qui sera arrondi à 1 par la calculatrice.<br /> Donc 1 peut sortir avec rand.<br /> <br /> == Syntaxe ==<br /> ''rand'' seul est reconnu comme une valeur et peut être utilisé dans des calculs.<br /> On peut également l'utiliser pour donner une valeur à une variable:<br /> <br /> rand→A<br /> <br /> == Réglage du Seed ==<br /> On peut initialiser le seed de rand en faisant:<br /> <br /> ''seed''→rand<br /> <br /> où ''seed'' est la valeur de seed choisie, qui permet le calcul des nombres pseudo-aléatoires.<br /> Après chaque effaçage de la RAM, le seed est remis à 0, d'où le fait que les nombres aléatoires sont toujours les mêmes directement après un RAM Cleared.<br /> Par exemple, le seed 196164532 permet d'obtenir 1 au premier rand suivant.<br /> <br /> Les nombres aléatoires sont calculés à partir du seed avec l'algorithme congruenciel de P. l'Ecuyer.<br /> <br /> == Utilisations particulières ==<br /> <br /> * L'utilisation du seed au début d'un programme permet d'être sur que le programme fonctionne de la même manière à chaque fois, par exemple lorsque l'on recherche un bug.<br /> * Elle peut également être utilisée pour crypter des données, en utilisant le seed comme clé secrète.<br /> <br /> * rand(''nombre de valeurs'') renvoie une liste de nombres aléatoires, qui prend un certain temps à être calculée. Si ce nombre et grand, la commande peut être utilisée pour créer un délai, ce qui est plus léger que l'utilisation d'une boucle For(). Il est également possible d'utiliser cette technique sans modifier Ans en faisant:<br /> :If dim(rand(N))<br /> <br /> == Emplacement ==<br /> * Depuis l'éditeur de programmes, tapez [math][gauche][1]<br /> * Dans le catalogue<br /> == Modèles concernés ==<br /> Toutes les TI-z80 de la [[TI-81]] à la [[TI-86]].<br /> <br /> == Messages d'erreur ==<br /> ; ERR DOMAIN<br /> Si le nombres de valeurs aléatoires à générer avec rand(N) n'est pas un entier entre 1 et 999.<br /> <br /> <br /> == Informations complémentaires ==<br /> * Poids du Token: 1 octet<br /> == Voir aussi ==<br /> * [http://tibasicdev.wikidot.com/rand Sur TI-Basic Developer]<br /> * [[TI-Basic/z80/maths/numeric/randInt|randInt()]]<br /> * [[TI-Basic/z80/maths/numeric/randBin|randBin()]]<br /> * [[TI-Basic/z80/maths/numeric/randIntNoRep|randIntNoRep()]]<br /> <br /> <br /> {{TI-Basicz80}}</div> Persalteas