<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Negative Zufallszahlen?]]></title><description><![CDATA[<p>Ich möchte per Zufall Zahlen zwischen -32768 und 32768 erzeugen.<br />
ich weiß wohl das man mit rand()%wert positive zahlen erzeugt!<br />
Macht man es vielleicht so,das man eine zweite Zahl zwischen 0 und 1 erzeugt,<br />
die Zahl abfragt (0 oder 1) und dann je nachdem die erste mit -1 multiplieziert<br />
oder nicht!</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/79132/negative-zufallszahlen</link><generator>RSS for Node</generator><lastBuildDate>Tue, 30 Jun 2026 00:58:41 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/79132.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 08 Jul 2004 10:37:19 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Negative Zufallszahlen? on Thu, 08 Jul 2004 10:37:19 GMT]]></title><description><![CDATA[<p>Ich möchte per Zufall Zahlen zwischen -32768 und 32768 erzeugen.<br />
ich weiß wohl das man mit rand()%wert positive zahlen erzeugt!<br />
Macht man es vielleicht so,das man eine zweite Zahl zwischen 0 und 1 erzeugt,<br />
die Zahl abfragt (0 oder 1) und dann je nachdem die erste mit -1 multiplieziert<br />
oder nicht!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/555893</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/555893</guid><dc:creator><![CDATA[Terradreamer]]></dc:creator><pubDate>Thu, 08 Jul 2004 10:37:19 GMT</pubDate></item><item><title><![CDATA[Reply to Negative Zufallszahlen? on Thu, 08 Jul 2004 10:45:02 GMT]]></title><description><![CDATA[<p>Zufallszahl aus dem doppelten positiven Bereich erzeugen und dann den positiven Bereich subtrahieren.</p>
<pre><code class="language-cpp">int plusminus10 = (rand() % 20) - 10;
</code></pre>
<p>Was hat das speziell mit dem BCB zu tun? Immer dran denken, dass wir für allgemeine Fragen extra allgmeine Foren haben (ANSI C, C++, Rund um).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/555903</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/555903</guid><dc:creator><![CDATA[Jansen]]></dc:creator><pubDate>Thu, 08 Jul 2004 10:45:02 GMT</pubDate></item></channel></rss>