<?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[float range auf int range abbilden --&amp;gt; Suche guten Algorithmus]]></title><description><![CDATA[<p>Als Eingabe bekomme ich einen gleitkomma-wert (float) x im Werteberreich:<br />
0&lt;=x&lt;=1<br />
Als Ausgabe möchte ich einen ganzzahlwert (int) y im Wertebereich:<br />
-6000&lt;=y&lt;=5000</p>
<p>Jetzt suche ich einen Algorithmus der mir den Eingabewert auf den passenden ausgabewert mappt. Mir ist klar, dass dabei Daten verloren gehen. Mir geht es dabei lediglich um eine &quot;Schadensbegrenzung&quot;.</p>
<p>Gruß<br />
Rüdiger</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/248612/float-range-auf-int-range-abbilden-gt-suche-guten-algorithmus</link><generator>RSS for Node</generator><lastBuildDate>Wed, 16 Sep 2026 22:00:58 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/248612.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 27 Aug 2009 06:00:30 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to float range auf int range abbilden --&amp;gt; Suche guten Algorithmus on Thu, 27 Aug 2009 06:00:30 GMT]]></title><description><![CDATA[<p>Als Eingabe bekomme ich einen gleitkomma-wert (float) x im Werteberreich:<br />
0&lt;=x&lt;=1<br />
Als Ausgabe möchte ich einen ganzzahlwert (int) y im Wertebereich:<br />
-6000&lt;=y&lt;=5000</p>
<p>Jetzt suche ich einen Algorithmus der mir den Eingabewert auf den passenden ausgabewert mappt. Mir ist klar, dass dabei Daten verloren gehen. Mir geht es dabei lediglich um eine &quot;Schadensbegrenzung&quot;.</p>
<p>Gruß<br />
Rüdiger</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1767416</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1767416</guid><dc:creator><![CDATA[RüdigerL]]></dc:creator><pubDate>Thu, 27 Aug 2009 06:00:30 GMT</pubDate></item><item><title><![CDATA[Reply to float range auf int range abbilden --&amp;gt; Suche guten Algorithmus on Thu, 27 Aug 2009 06:12:23 GMT]]></title><description><![CDATA[<p>Wozu einen Algorithmus?</p>
<pre><code class="language-cpp">y = static_cast&lt;int&gt;(x * 11000 - 6000);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1767419</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1767419</guid><dc:creator><![CDATA[Dasd]]></dc:creator><pubDate>Thu, 27 Aug 2009 06:12:23 GMT</pubDate></item><item><title><![CDATA[Reply to float range auf int range abbilden --&amp;gt; Suche guten Algorithmus on Thu, 27 Aug 2009 07:52:02 GMT]]></title><description><![CDATA[<p>Dasd schrieb:</p>
<blockquote>
<p>Wozu einen Algorithmus?</p>
<pre><code class="language-cpp">y = static_cast&lt;int&gt;(x * 11000 - 6000);
</code></pre>
</blockquote>
<p>Das ist ein Algorithmus.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1767455</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1767455</guid><dc:creator><![CDATA[volkard]]></dc:creator><pubDate>Thu, 27 Aug 2009 07:52:02 GMT</pubDate></item></channel></rss>