| VI_and | VSI_and | VLI_and | VQI_and |
| VU_and | VUS_and | VUL_and | VUI_and |
|
| Function | Bit-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/Delphi | uses VImath;
procedure VI_and( Y, X:iVector; size:UInt; C:Integer );
(similarly all other functions of this family) |
|
| Description | Yi = (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 ); |
|
|
|
|