<?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[Ausgaben mit Nachkommastellen]]></title><description><![CDATA[<p>Was bedeutet die Ausgabe printf(&quot;%8.2f&quot;,rest)</p>
<p>Ich habe in einem Latex Manual gelesen, dass reelle Zahlen,<br />
mit mind. 8 Stellen + 2 Nachkommastellen ausgegeben werden.</p>
<p>Ich habe aber im Programm aber keine 8 Stellen, sondern 3 und 2 Nachkommastellen.</p>
<p>Die Ausgabe beginnt bei 875 und zählt bis auf 0 runter.</p>
<p>Kann es sein dass nur der Wert 800 hier die Relevanz zeigt.<br />
Hier fängt es laut einer Berechnung bei 875 an.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/190903/ausgaben-mit-nachkommastellen</link><generator>RSS for Node</generator><lastBuildDate>Fri, 25 Sep 2026 19:45:27 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/190903.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 28 Aug 2007 09:41:05 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Ausgaben mit Nachkommastellen on Tue, 28 Aug 2007 09:41:05 GMT]]></title><description><![CDATA[<p>Was bedeutet die Ausgabe printf(&quot;%8.2f&quot;,rest)</p>
<p>Ich habe in einem Latex Manual gelesen, dass reelle Zahlen,<br />
mit mind. 8 Stellen + 2 Nachkommastellen ausgegeben werden.</p>
<p>Ich habe aber im Programm aber keine 8 Stellen, sondern 3 und 2 Nachkommastellen.</p>
<p>Die Ausgabe beginnt bei 875 und zählt bis auf 0 runter.</p>
<p>Kann es sein dass nur der Wert 800 hier die Relevanz zeigt.<br />
Hier fängt es laut einer Berechnung bei 875 an.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1353613</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1353613</guid><dc:creator><![CDATA[quovadis2]]></dc:creator><pubDate>Tue, 28 Aug 2007 09:41:05 GMT</pubDate></item><item><title><![CDATA[Reply to Ausgaben mit Nachkommastellen on Tue, 28 Aug 2007 10:49:41 GMT]]></title><description><![CDATA[<p>Prinzipiell bedeutet %8.2f eine Fließkommazahl mit maximal 8 Stellen vor und 2 Stellen nach dem Komma.</p>
<p>Vielleicht postest du mal den betreffenden Code.</p>
<p>gruß<br />
Martin</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1353679</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1353679</guid><dc:creator><![CDATA[mad_martin]]></dc:creator><pubDate>Tue, 28 Aug 2007 10:49:41 GMT</pubDate></item><item><title><![CDATA[Reply to Ausgaben mit Nachkommastellen on Tue, 28 Aug 2007 11:36:11 GMT]]></title><description><![CDATA[<pre><code>main(){
int x,y;
double preis,rest;

printf(&quot;Restwerttabelle&quot;);
printf(&quot;Neupreiseingabe: &quot;);
scanf(&amp;preis);
printf(&quot;Zeitraum&quot;)
printf(&quot;\nJahr\t8 Jahre\t6 Jahre\t4 Jahre&quot;);
for(x=1,x&lt;=8;x+1){ /*äüßere Schleife*/
printf(&quot;\n%i\t&quot;,x);
for(y=8;y&gt;=4;y=y-2){
rest=preis-x*preis/y;
if(rest&lt;0)
break;
pritnf(&quot;%8.2f&quot;,rest);
}
}
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1353726</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1353726</guid><dc:creator><![CDATA[quovadis3]]></dc:creator><pubDate>Tue, 28 Aug 2007 11:36:11 GMT</pubDate></item><item><title><![CDATA[Reply to Ausgaben mit Nachkommastellen on Tue, 28 Aug 2007 11:47:05 GMT]]></title><description><![CDATA[<p>quovadis3 schrieb:</p>
<blockquote>
<pre><code>main(){
int x,y;
double preis,rest;

printf(&quot;Restwerttabelle&quot;);
printf(&quot;Neupreiseingabe: &quot;);
scanf(&amp;preis);
printf(&quot;Zeitraum&quot;)
printf(&quot;\nJahr\t8 Jahre\t6 Jahre\t4 Jahre&quot;);
for(x=1,x&lt;=8;x+1){ /*äüßere Schleife*/
printf(&quot;\n%i\t&quot;,x);
for(y=8;y&gt;=4;y=y-2){
rest=preis-x*preis/y;
if(rest&lt;0)
break;
pritnf(&quot;%8.2f&quot;,rest);
}
}
}
</code></pre>
</blockquote>
<pre><code class="language-cpp">#include &lt;iostream&gt;

int main() {
  int x,y;
  double preis,rest;
  std::cout &lt;&lt; &quot;Restwerttabelle &quot; &lt;&lt; std::endl 
            &lt;&lt; &quot;Neupreiseingabe: &quot; &lt;&lt; std::endl;
  std::cin  &gt;&gt; preis;
  std::cout &lt;&lt; &quot;Zeitraum&quot; &lt;&lt; std::endl 
            &lt;&lt; &quot;\nJahr\t8 Jahre\t6 Jahre\t4 Jahre&quot; &lt;&lt; std::endl;
  for(x = 1; x &lt;= 8; ++x)  //  :arrow_right:  x+1 bewirkt nur, dass jedes Mal 2 verwendet wird =&gt;  das Programm hängt sich hier auf, da x nicht verändert wird
    std::cout &lt;&lt; x &lt;&lt; &quot;\t &quot; &lt;&lt; std::endl;
  for(y = 8;y &gt;= 4;y -= 2){
    rest = preis - x*preis/y;
  if(rest&gt;=0)
    std::cout &lt;&lt; rest &lt;&lt; std::endl;

}
</code></pre>
<p>Einigen SChreibfehler waren auch drin (pritnf ...).<br />
Das war ein C Code und kein C++ Code <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="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1353736</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1353736</guid><dc:creator><![CDATA[Checker*amp*Murckser]]></dc:creator><pubDate>Tue, 28 Aug 2007 11:47:05 GMT</pubDate></item><item><title><![CDATA[Reply to Ausgaben mit Nachkommastellen on Tue, 28 Aug 2007 11:55:15 GMT]]></title><description><![CDATA[<p>printf() Formatkennung sind sowieso ein Kapitel für sich (und die ganze Funktion gilt bei C++'lern oft als veraltet), aber ich versuch's mal:</p>
<p>% - Beginn der Formatkennung<br />
8 - minimale Größe des Ausgabefeldes (wird notfalls links mit Leerzeichen aufgefüllt)<br />
.2 - Anzahl der Nachkommastellen<br />
f - Ausgabe eines double-Wertes in &quot;nichtwissenschaflicher&quot; Darstellung</p>
<p>-&gt; deine Zahlen werden mit einer Breite von (mindestens) 8 Zeichen dargestellt, davon ein Komma und zwei Nachkommastellen (und solange die Zahlen in diese 8 Stellen reinpassen, werden sie schön untereinander ausgerichtet).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1353749</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1353749</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Tue, 28 Aug 2007 11:55:15 GMT</pubDate></item><item><title><![CDATA[Reply to Ausgaben mit Nachkommastellen on Tue, 28 Aug 2007 13:15:32 GMT]]></title><description><![CDATA[<p>Danke für die nette Erläuterung. Hab nur provosorisch den Code dahin geklatscht, daher ohne \n's, \t's. Hab den Mist aus dem Erlenkötter.</p>
<p>Aber dachte auch, dass der zwar 8 Stellen bereitstellt sozusagen aber halt nicht belegt. War halt ne Willkürliche Belegegung. Hätte auch &quot;%4.2lf&quot; schreiben können.</p>
<p>Danke auch für die Erklärung dass sich das Programm aufhängt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1353834</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1353834</guid><dc:creator><![CDATA[quovadis4]]></dc:creator><pubDate>Tue, 28 Aug 2007 13:15:32 GMT</pubDate></item></channel></rss>