To: J3 J3/14-182
From: David Muxworthy
Subject: UK proposal UK-20 Bitwise logical functions
Date: 2014 June 09
Status: For Consideration
Basic Functionality: Improve consistency of IAND, IEOR, IOR
Rationale:
The MAX and MIN functions may take an arbitrary number of arguments.
There is no reason to restrict the number of arguments of the bitwise
logical functions to two. To remove the limit would allow expressions
with multiple logical function references to be easier both to write
and to understand.
Specification:
Edits are required to Table 13.1 and subclauses 13.7.72, 13.7.78,
13.7.82. Other references to these functions need not be altered.
Syntax:
Allow intrinsic functions IAND, IEOR, IOR to have an arbitrary number
of arguments.
Edits to J3/14-007r1(= N2014):
[354:24-355:2] The following is a complete replacement for subclause
13.7.72. Syntax for (IEOR) 13.7.78 [356:35-357:10] and (IOR) 13.7.82
[358:31-359:5] follows a similar pattern.
<<13.7.72 IAND (I1, I2 [,I3,...])>>
<> Bitwise AND.
<> Elemental function.
<> The arguments shall all be of type integer or
. At least one argument shall be of type
integer. Arguments of type integer shall all have the same kind type
parameter.
<> Same as the type of the integer
argument(s).
<> If an argument is a , it is
first converted as if by the intrinsic function INT to type integer
with the kind type parameter of the integer argument(s). The result
has the value obtained by combining all arguments in turn bit-by-bit
according to the following truth table:
I_m I_n IAND (I_m, I_n)
1 1 1
1 0 0
0 1 0
0 0 0
The model for the interpretation of an integer value as a sequence of
bits is in 13.3.
<> IAND (1, 3, 5) has the value 1. IAND (42, 57, 63, 95)
has the value 8.