<?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[kubikwurzel negativer zahlen]]></title><description><![CDATA[<p>HALL0.</p>
<p>ich möchte in meinem programm gerne von negativen zahlen die kubikwurzel berechnen, leider scheint es so nicht zu funktionieren:</p>
<pre><code class="language-cpp">zahl = (double)1/3;
zahl = pow((double)-2,(double)zahl);
</code></pre>
<p>hat jemand eine bessere idee?</p>
<p>DANKE.<br />
STICK.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/155048/kubikwurzel-negativer-zahlen</link><generator>RSS for Node</generator><lastBuildDate>Tue, 08 Sep 2026 03:26:42 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/155048.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 02 Aug 2006 08:22:33 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to kubikwurzel negativer zahlen on Wed, 02 Aug 2006 08:22:33 GMT]]></title><description><![CDATA[<p>HALL0.</p>
<p>ich möchte in meinem programm gerne von negativen zahlen die kubikwurzel berechnen, leider scheint es so nicht zu funktionieren:</p>
<pre><code class="language-cpp">zahl = (double)1/3;
zahl = pow((double)-2,(double)zahl);
</code></pre>
<p>hat jemand eine bessere idee?</p>
<p>DANKE.<br />
STICK.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1108981</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1108981</guid><dc:creator><![CDATA[stick_thai]]></dc:creator><pubDate>Wed, 02 Aug 2006 08:22:33 GMT</pubDate></item><item><title><![CDATA[Reply to kubikwurzel negativer zahlen on Wed, 02 Aug 2006 08:31:37 GMT]]></title><description><![CDATA[<p><a href="http://man.cx/pow" rel="nofollow">man: pow</a>:</p>
<blockquote>
<p>The function pow(x, y) checks to see if x &lt; 0 and y is not an integer, in the event this is true, the global variable errno is set to EDOM and on the VAX and Tahoe generate a reserved operand fault.</p>
</blockquote>
<p>Oder auf Deutsch: von negativen Zahlen kannst du nur ganzzahlige Potenzen bilden. Aber du kannst das -1 ja &quot;ausklammern&quot;, um auf vernünftige Werte zu kommen:</p>
<pre><code class="language-cpp">zahl = - pow( 2 , 1.0/3);
</code></pre>
<p>Wenn du mit Variablen arbeitest, versuch folgendes:</p>
<pre><code class="language-cpp">int sign(double val)
{
  return val&gt;=0 ? 1 : -1;
}

zahl = sign(wert) * pow( fabs(wert), 1.0/3 );
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1108994</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1108994</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Wed, 02 Aug 2006 08:31:37 GMT</pubDate></item></channel></rss>