Files
2025-10-25 03:02:53 +03:00

32 lines
1.4 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[expr.or]
# 7 Expressions [[expr]](./#expr)
## 7.6 Compound expressions [[expr.compound]](expr.compound#expr.or)
### 7.6.13 Bitwise inclusive OR operator [expr.or]
[inclusive-or-expression:](#nt:inclusive-or-expression "7.6.13Bitwise inclusive OR operator[expr.or]")
[*exclusive-or-expression*](expr.xor#nt:exclusive-or-expression "7.6.12Bitwise exclusive OR operator[expr.xor]")
[*inclusive-or-expression*](#nt:inclusive-or-expression "7.6.13Bitwise inclusive OR operator[expr.or]") | [*exclusive-or-expression*](expr.xor#nt:exclusive-or-expression "7.6.12Bitwise exclusive OR operator[expr.xor]")
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/expressions.tex#L7719)
The | operator groups left-to-right[.](#1.sentence-1)
The operands shall be of integral or unscoped enumeration type[.](#1.sentence-2)
The usual arithmetic conversions ([[expr.arith.conv]](expr.arith.conv "7.4Usual arithmetic conversions")) are performed[.](#1.sentence-3)
Given the coefficients xi and yi of the base-2 representation ([[basic.fundamental]](basic.fundamental "6.9.2Fundamental types"))
of the converted operands x and y,
the coefficient ri of the base-2 representation of the result r is 1 if at least one of xi and yi is 1, and 0 otherwise[.](#1.sentence-4)
[*Note [1](#note-1)*:
The result is the bitwise inclusive or function of the operands[.](#1.sentence-5)
— *end note*]