<?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[implizieter Cast]]></title><description><![CDATA[<p>hallo,</p>
<p>wenn ich einen char mit einem float addiere, wird dann der char impliziet in einen float umgewandelt?</p>
<p>danke</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/311245/implizieter-cast</link><generator>RSS for Node</generator><lastBuildDate>Mon, 03 Aug 2026 16:43:32 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/311245.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 30 Nov 2012 15:55:45 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to implizieter Cast on Fri, 30 Nov 2012 15:55:45 GMT]]></title><description><![CDATA[<p>hallo,</p>
<p>wenn ich einen char mit einem float addiere, wird dann der char impliziet in einen float umgewandelt?</p>
<p>danke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2276133</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2276133</guid><dc:creator><![CDATA[impl]]></dc:creator><pubDate>Fri, 30 Nov 2012 15:55:45 GMT</pubDate></item><item><title><![CDATA[Reply to implizieter Cast on Fri, 30 Nov 2012 15:58:07 GMT]]></title><description><![CDATA[<p>Was hindert dich dran, es auszuprobieren? <a href="http://ideone.com/" rel="nofollow">http://ideone.com/</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2276134</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2276134</guid><dc:creator><![CDATA[daddy_felix]]></dc:creator><pubDate>Fri, 30 Nov 2012 15:58:07 GMT</pubDate></item><item><title><![CDATA[Reply to implizieter Cast on Fri, 30 Nov 2012 16:02:07 GMT]]></title><description><![CDATA[<p>Ja. Das ist jedoch kein Cast im eigentlichen Sinne, sondern eine &quot;conversion&quot; ( = Umwandlung). Speziell eine floating-integral conversion, nach 4.9,2 des Standards:</p>
<blockquote>
<p>A prvalue of an integer type or of an unscoped enumeration type can be converted to a prvalue of a floating<br />
point type. The result is exact if possible. If the value being converted is in the range of values that can<br />
be represented but the value cannot be represented exactly, it is an implementation-defined choice of either<br />
the next lower or higher representable value. [ Note: Loss of precision occurs if the integral value cannot<br />
be represented exactly as a value of the floating type. — end note ] If the value being converted is outside<br />
the range of values that can be represented, the behavior is undefined. If the source type is bool, the value<br />
false is converted to zero and the value true is converted to one.</p>
</blockquote>
<p>Diese Umwandlung wird benutzt gemäß der allgemeinen Regeln für Ausdrücke (Kapitel 5):</p>
<blockquote>
<p>Many binary operators that expect operands of arithmetic or enumeration type cause conversions and yield<br />
result types in a similar way. The purpose is to yield a common type, which is also the type of the result.<br />
This pattern is called the usual arithmetic conversions, which are defined as follows:<br />
— If either operand is of scoped enumeration type (7.2), no conversions are performed; if the other<br />
operand does not have the same type, the expression is ill-formed.<br />
<strong>— If either operand is of type long double, the other shall be converted to long double.<br />
— Otherwise, if either operand is double, the other shall be converted to double.<br />
— Otherwise, if either operand is float, the other shall be converted to float.</strong><br />
— Otherwise, the integral promotions (4.5) shall be performed on both operands. Then the following<br />
rules shall be applied to the promoted operands:<br />
— If both operands have the same type, no further conversion is needed.<br />
— Otherwise, if both operands have signed integer types or both have unsigned integer types, the<br />
operand with the type of lesser integer conversion rank shall be converted to the type of the<br />
operand with greater rank.<br />
— Otherwise, if the operand that has unsigned integer type has rank greater than or equal to the<br />
rank of the type of the other operand, the operand with signed integer type shall be converted to<br />
the type of the operand with unsigned integer type.<br />
— Otherwise, if the type of the operand with signed integer type can represent all of the values of<br />
the type of the operand with unsigned integer type, the operand with unsigned integer type shall<br />
be converted to the type of the operand with signed integer type.<br />
— Otherwise, both operands shall be converted to the unsigned integer type corresponding to the<br />
type of the operand with signed integer type.</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/2276136</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2276136</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Fri, 30 Nov 2012 16:02:07 GMT</pubDate></item><item><title><![CDATA[Reply to implizieter Cast on Fri, 30 Nov 2012 16:02:28 GMT]]></title><description><![CDATA[<p>anscheinend ja <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="🙂"
    /><br />
danke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2276137</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2276137</guid><dc:creator><![CDATA[impl]]></dc:creator><pubDate>Fri, 30 Nov 2012 16:02:28 GMT</pubDate></item></channel></rss>