<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wikidot="http://www.wikidot.com/rss-namespace">

	<channel>
		<title>possible alternative to the rand command</title>
		<link>https://tibasicdev.wikidot.com/forum/t-13893985/possible-alternative-to-the-rand-command</link>
		<description>Posts in the discussion thread &quot;possible alternative to the rand command&quot;</description>
				<copyright></copyright>
		<lastBuildDate>Thu, 12 Nov 2026 17:56:02 +0000</lastBuildDate>
		
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-13893985#post-4835512</guid>
				<title>Re: possible alternative to the rand command</title>
				<link>https://tibasicdev.wikidot.com/forum/t-13893985/possible-alternative-to-the-rand-command#post-4835512</link>
				<description></description>
				<pubDate>Thu, 03 Dec 2020 23:12:41 +0000</pubDate>
				<wikidot:authorName>Trenly</wikidot:authorName>				<wikidot:authorUserId>1905506</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>That would depend on what the starting value of X is, which is no different than seeding the <a href="https://tibasicdev.wikidot.com/rand">rand</a> function. Additionally, any PRNG can be manipulated if the algorithm of the PRNG is known. You also can check the distribution of your function with enough trials, and it can be seen that the function is strictly decreasing along the negative half of a triangular <span style="text-decoration: line-through;">distribution</span>. This means that no matter what X starts as, it will eventually give an overflow error as it gets too large; so, it isn't exactly a PRNG since given any input, you know that the next input will be more negative and that no two values will occur twice</p> <p>While this may work for some applications, I personally don't feel that it classifies as a PRNG, as it doesn't create a probability distribution when the number of iterations goes to infinity</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-13893985#post-4835320</guid>
				<title>possible alternative to the rand command</title>
				<link>https://tibasicdev.wikidot.com/forum/t-13893985/possible-alternative-to-the-rand-command#post-4835320</link>
				<description></description>
				<pubDate>Thu, 03 Dec 2020 16:59:29 +0000</pubDate>
								<wikidot:authorUserId>6979576</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>so a day or 2 ago i found out that</p> <div class="code"> <pre><code>1-abs(2x-1)</code></pre></div> <br /> can be used as a PRNG, like this: <div class="code"> <pre><code>Prompt X While 1 1-abs(2X-1→X Output(1,1,X End</code></pre></div> <p>it might even be a alternative to the rand command, and can be useful if you have a program that uses the rand command but you don't want anyone manipulating the numbers that are outputted.</p> 
				 	]]>
				</content:encoded>							</item>
				</channel>
</rss>