<?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[double hoch rechnen (double^int)]]></title><description><![CDATA[<p>guten Abend</p>
<p>ich wollte mir eine Funktion schreiben, die die x-te Wurzel einer beliebigen Zahl ausrechnet:</p>
<pre><code class="language-cpp">double wurzel(int i, double zahl)
{
	double x = 2;
	double y = 0;
	int z = i-1;
	int e = 0;

	while (e &lt; 20 &amp;&amp; x != y)
	{
		y = zahl/(x^z); // error C2296: '^': Ungültig, da der linke Operand vom Typ 'double' ist
		x = (z*x+y)/i;
		e++;
	}
	return x;
}
</code></pre>
<p>der Error ist recht eindeutig, nun die frage, wie kriege ich das hin?<br />
Ist es überhaupt möglich, ohne einbindung einer extra library eine Zahl vom typ double hoch zu rechnen??</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/211882/double-hoch-rechnen-double-int</link><generator>RSS for Node</generator><lastBuildDate>Wed, 14 Oct 2026 12:28:27 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/211882.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 28 Apr 2008 19:20:26 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to double hoch rechnen (double^int) on Mon, 28 Apr 2008 19:20:26 GMT]]></title><description><![CDATA[<p>guten Abend</p>
<p>ich wollte mir eine Funktion schreiben, die die x-te Wurzel einer beliebigen Zahl ausrechnet:</p>
<pre><code class="language-cpp">double wurzel(int i, double zahl)
{
	double x = 2;
	double y = 0;
	int z = i-1;
	int e = 0;

	while (e &lt; 20 &amp;&amp; x != y)
	{
		y = zahl/(x^z); // error C2296: '^': Ungültig, da der linke Operand vom Typ 'double' ist
		x = (z*x+y)/i;
		e++;
	}
	return x;
}
</code></pre>
<p>der Error ist recht eindeutig, nun die frage, wie kriege ich das hin?<br />
Ist es überhaupt möglich, ohne einbindung einer extra library eine Zahl vom typ double hoch zu rechnen??</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1499994</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1499994</guid><dc:creator><![CDATA[Argus Magnus]]></dc:creator><pubDate>Mon, 28 Apr 2008 19:20:26 GMT</pubDate></item><item><title><![CDATA[Reply to double hoch rechnen (double^int) on Mon, 28 Apr 2008 19:25:03 GMT]]></title><description><![CDATA[<p>a) pow<br />
b) x^y = x*x*...*x (das ganze y mal)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1499996</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1499996</guid><dc:creator><![CDATA[ihoernchen]]></dc:creator><pubDate>Mon, 28 Apr 2008 19:25:03 GMT</pubDate></item><item><title><![CDATA[Reply to double hoch rechnen (double^int) on Mon, 28 Apr 2008 19:27:37 GMT]]></title><description><![CDATA[<p>zu a) ich will die funktion selber schreibe <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /> ich weiss von pow und co.<br />
b) wieso ist es nicht möglich eine doublezahl &quot;direkt&quot; hochzurechnen, ist doch recht umständlich so...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1499999</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1499999</guid><dc:creator><![CDATA[Argus Magnus]]></dc:creator><pubDate>Mon, 28 Apr 2008 19:27:37 GMT</pubDate></item><item><title><![CDATA[Reply to double hoch rechnen (double^int) on Mon, 28 Apr 2008 19:32:04 GMT]]></title><description><![CDATA[<p>Argus Magnus schrieb:</p>
<blockquote>
<p>zu a) ich will die funktion selber schreibe <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /> ich weiss von pow und co.<br />
b) wieso ist es nicht möglich eine doublezahl &quot;direkt&quot; hochzurechnen, ist doch recht umständlich so...</p>
</blockquote>
<p><strong>a)</strong> Dann benutz eine For-Schleife. <code>pow(...)</code> ist jedoch sowieso schneller als deine eigene Funktion, und du kannst auch nicht-ganzzahlige Exponenten verwenden.<br />
<strong>b)</strong> Weil ^ nicht der Operator für die Potenz, sondern für eine bitweise XOR-Verknüpfung ist.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1500003</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1500003</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Mon, 28 Apr 2008 19:32:04 GMT</pubDate></item><item><title><![CDATA[Reply to double hoch rechnen (double^int) on Mon, 28 Apr 2008 19:34:24 GMT]]></title><description><![CDATA[<p>Weil das eben nicht zum C++Standard gehört.</p>
<p>Du kannst übrigens auch kein int &quot;direkt hochrechnen&quot;</p>
<p>^ ist übrigens das bitweise xor.</p>
<p><a href="http://de.wikipedia.org/wiki/Babylonisches_Wurzelziehen" rel="nofollow">http://de.wikipedia.org/wiki/Babylonisches_Wurzelziehen</a></p>
<p>hf</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1500004</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1500004</guid><dc:creator><![CDATA[stein]]></dc:creator><pubDate>Mon, 28 Apr 2008 19:34:24 GMT</pubDate></item><item><title><![CDATA[Reply to double hoch rechnen (double^int) on Mon, 28 Apr 2008 19:36:52 GMT]]></title><description><![CDATA[<p>ach so xD<br />
man lernt doch nie aus <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
<p>und zu deinem wikipedia artikel: meine funktion beinhaltet nichts anderes als das Heronverfahren...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1500006</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1500006</guid><dc:creator><![CDATA[Argus Magnus]]></dc:creator><pubDate>Mon, 28 Apr 2008 19:36:52 GMT</pubDate></item><item><title><![CDATA[Reply to double hoch rechnen (double^int) on Tue, 29 Apr 2008 05:21:26 GMT]]></title><description><![CDATA[<blockquote>
<p>b) x^y = x*x*...*x (das ganze y mal)</p>
</blockquote>
<p>Falsch! Zeig mir mal wie du auf die Weise 2<sup>0.5</sup> rechnest.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1500162</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1500162</guid><dc:creator><![CDATA[Tyrdal]]></dc:creator><pubDate>Tue, 29 Apr 2008 05:21:26 GMT</pubDate></item><item><title><![CDATA[Reply to double hoch rechnen (double^int) on Tue, 29 Apr 2008 05:54:27 GMT]]></title><description><![CDATA[<p>Tyrdal schrieb:</p>
<blockquote>
<blockquote>
<p>b) x^y = x*x*...*x (das ganze y mal)</p>
</blockquote>
<p>Falsch! Zeig mir mal wie du auf die Weise 2<sup>0.5</sup> rechnest.</p>
</blockquote>
<p>betreffzeile nochmal lesen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1500175</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1500175</guid><dc:creator><![CDATA[sothis_]]></dc:creator><pubDate>Tue, 29 Apr 2008 05:54:27 GMT</pubDate></item><item><title><![CDATA[Reply to double hoch rechnen (double^int) on Tue, 29 Apr 2008 15:34:18 GMT]]></title><description><![CDATA[<p>ihoernchen schrieb:</p>
<blockquote>
<p>b) x^y = x*x*...*x (das ganze y mal)</p>
</blockquote>
<p>Trick 17:<br />
Solange y ohne Rest durch 2 teilbar ist tue das und multipliziere x mit sich selbst.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1500645</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1500645</guid><dc:creator><![CDATA[.filmor]]></dc:creator><pubDate>Tue, 29 Apr 2008 15:34:18 GMT</pubDate></item></channel></rss>