VI_andVSI_andVLI_andVQI_and
VU_andVUS_andVUL_andVUI_and
FunctionBit-wise AND operation.
Syntax C/C++#include <VImath.h>
void VI_and( iVector Y, iVector X, ui size, int C );

    (similarly all other functions of this family)
C++ VecObj#include <OptiVec.h>
void vector<T>::and( const vector<T>& X, const T& C );
Pascal/Delphiuses VImath;
procedure VI_and( Y, X:iVector; size:UInt; C:Integer );

    (similarly all other functions of this family)
DescriptionYi = (Xi) & C
The bit-wise AND operation is performed on each element Xi with the bit-mask given by C. A bit is 1 in Yi, if it was 1 both in Xi and in C, and 0 otherwise. Perhaps the most useful application of this family of functions is the fast "modulo" operation on unsigned or positive numbers with the modulus being an integer power of 2. For example, a modulo division by 64 is performed by
VU_and( Y, X, size, 64-1 );
Error handlingnone
Return valuenone
See alsoVI_not,   VI_or,   VI_xor

VectorLib Table of Contents  OptiVec home