Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP C/HP-UX Reference Manual: Workstations and Servers > Chapter 5 Expressions

Bitwise Inclusive OR Operator

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

The bitwise inclusive OR operator (|) performs the bitwise inclusive OR function on its operands.

Syntax

inclusive-OR-expression ::=
exclusive-OR-expression
inclusive-OR-expression | exclusive-OR-expression

Description

The result of the binary operator | is the bitwise OR function of the two operands. Both operands must be integral types. The usual arithmetic conversions are performed on the operands. The type of the result is the converted type of the operands. The result is not an lvalue.

For each of the corresponding bits in the left operand, the right operand, and the result, the following table indicates the result of a bitwise OR operation.

Table 5-6 Bitwise OR Results

Bit in Left Operand

Bit in Right Operand

Bit in Result

0

0

0

0

1

1

1

0

1

1

1

1

 

Example

var1 | var2
Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1996 Hewlett-Packard Development Company, L.P.