Difference between revisions of "BitOr"

(Created page with "category:Bit functions ''new in Analytica 4.7'' == BitOr( x'', I'' ) == Returns the bitwise OR of the integer portions of an array of numbers. Each bit in the resul...")
 
m (4.7 -> 5.0)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
[[category:Bit functions]]
 
[[category:Bit functions]]
  
''new in [[Analytica 4.7]]''
+
== BitOr(x'', I'') ==
 
+
Returns the bitwise OR of the integer portions of an array of numbers. Each bit in the result is on only if it is on in every integer in «x» along index «I»«I» can be omitted when taking the bitwise AND across the [[Implicit dimension]].
== BitOr( x'', I'' ) ==
 
 
 
Returns the bitwise OR of the integer portions of an array of numbers. Each bit in the result is on only if it is on in every integer in «x» along index «<code>I</code>»«<code>I</code>» can be omitted when taking the bitwise AND across the [[Implicit dimension]].
 
  
 
Each integer may have up to 64 bits.
 
Each integer may have up to 64 bits.
  
 
== Examples ==
 
== Examples ==
 +
To find the bitwise OR of three numbers, the numbers can be listed in brackets (the implicit index) and the index parameter omitted.
 +
:<code>BitAnd([21, 13, 25]) &rarr; 29</code>
  
To find the bitwise OR of three numbers, the numbers can be listed in brackets (the implicit index) and the index parameter omitted.
 
:<code>[[BitAnd]]( [21, 13, 25] )</code> &rarr; 29
 
 
This is more obvious when we write these same numbers in [[Binary and hexadecimal integer formats|binary notation]]:
 
This is more obvious when we write these same numbers in [[Binary and hexadecimal integer formats|binary notation]]:
:<code>[[BitAnd]]( [0b10101, 0b01101, 0b11001] ) &rarr; 0b11101</code>
+
:<code>BitAnd([0b10101, 0b01101, 0b11001]) &rarr; 0b11101</code>
  
Suppose x is the following 2-D array of integers
+
Suppose <code>x</code> is the following 2-D array of integers
 
:[[image:BitOr_x.png]]
 
:[[image:BitOr_x.png]]
 +
 
which is shown here in [[Binary and hexadecimal integer formats|binary notation]]
 
which is shown here in [[Binary and hexadecimal integer formats|binary notation]]
 +
 
:[[image:BitOr_x_binary.png]]
 
:[[image:BitOr_x_binary.png]]
 
then
 
then
:<code>[[BitOr]](x,I)</code> &rarr; [[image:BitOr_result1d.png]]  
+
:<code>BitOr(x, I) &rarr; </code>
:::= [[image:BitOr_result1.png]]
+
 
:<code>[[BitOr]](x,J)</code> &rarr; [[image:BitOr_result2.png]]
+
:[[image:BitOr_result1d.png]]  
 +
:::=  
 +
:[[image:BitOr_result1.png]]
 +
 
 +
:<code>BitOr(x, J) &rarr;</code>  
 +
 
 +
:[[image:BitOr_result2.png]]
 +
 
 +
==History==
 +
Introduced in [[Analytica 5.0]].
  
 
== See Also ==
 
== See Also ==
* [[BitAnd]], [[BitNot]], [[BitXOr]]
+
* [[BitAnd]]
* [[BitCount]], [[BitShift]]
+
* [[BitNot]]
* Logical [[AND]]
+
* [[BitXOr]]
 +
* [[BitCount]]
 +
* [[BitShift]]
 +
* Logical [[Or]]

Latest revision as of 01:27, 28 April 2016


BitOr(x, I)

Returns the bitwise OR of the integer portions of an array of numbers. Each bit in the result is on only if it is on in every integer in «x» along index «I». «I» can be omitted when taking the bitwise AND across the Implicit dimension.

Each integer may have up to 64 bits.

Examples

To find the bitwise OR of three numbers, the numbers can be listed in brackets (the implicit index) and the index parameter omitted.

BitAnd([21, 13, 25]) → 29

This is more obvious when we write these same numbers in binary notation:

BitAnd([0b10101, 0b01101, 0b11001]) → 0b11101

Suppose x is the following 2-D array of integers

BitOr x.png

which is shown here in binary notation

BitOr x binary.png

then

BitOr(x, I) →
BitOr result1d.png
=
BitOr result1.png
BitOr(x, J) →
BitOr result2.png

History

Introduced in Analytica 5.0.

See Also

Comments


You are not allowed to post comments.