File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 62286228\indextext {zero!undefined division by}%
62296229If the second operand of \tcode {/} or \tcode {\% } is zero, the behavior is
62306230undefined.
6231- For integral operands, the \tcode {/} operator yields the algebraic quotient with
6232- any fractional part discarded;
6233- \begin {footnote }
6234- This is often called truncation towards zero.
6235- \end {footnote }
6236- if the quotient \tcode {a/b} is representable in the type of the result,
6237- \tcode {(a/b)*b + a\% b} is equal to \tcode {a}; otherwise, the behavior
6231+ For integral operands, the \tcode {/} operator yields the algebraic quotient
6232+ rounded towards zero.
6233+ \begin {note }
6234+ If the quotient \tcode {a/b} is representable in the type of the result,
6235+ \tcode {(a/b)*b + a\% b} is equal to \tcode {a};
6236+ otherwise, the behavior
62386237of both \tcode {a/b} and \tcode {a\% b} is undefined.
6238+ \end {note }
62396239
62406240\rSec 2[expr.add]{Additive operators}%
62416241\indextext {expression!additive operators}%
You can’t perform that action at this time.
0 commit comments