IntShiftLeft
IntShiftLeft
Description
Shift an integer left by the given number of bit positions.
Parameters
| Name | Direction | Description |
|---|---|---|
value |
in | Integer to modify |
positions |
in | Number of zero bits to append on the right |
Usage example (from documentation)
IntShiftLeft(&value, 8);Usage example (Cross-references)
Usage examples (Cross-references)
- In
Int.c:437:
for (u64 i = 0; i < len; i++) {
IntShiftLeft(&result, 8);
int_add_u64_in_place(&result, bytes[i]);
}- In
Int.c:649:
}
void IntShiftLeft(Int *value, u64 positions) {
ValidateInt(value);- In
Int.c:839:
int_normalize(&partial);
IntShiftLeft(&partial, i);
IntAdd(&next, &acc, &partial);- In
Int.c:953:
Int shifted = IntClone(&normalized_divisor);
IntShiftLeft(&shifted, bit);
if (IntGE(&r, &shifted)) {- In
Int.c:1206:
}
IntShiftLeft(&high, high_shift);
while (IntLE(&low, &high)) {
Int value = IntFrom(1);
IntShiftLeft(&value, 64);
IntToU64(&value);- In
Int.Compare.c:57:
Int big = IntFrom(1);
IntShiftLeft(&big, 80);
bool result = (IntCompare(&value, &same) == 0);- In
Int.Access.c:90:
Int big = IntFrom(1);
IntShiftLeft(&big, 64);
bool result = IntFitsU64(&small);- In
Int.Access.c:133:
Int zero = IntInit();
IntShiftLeft(&power, 20);
bool result = IntIsPowerOfTwo(&one);- In
Int.Math.c:62:
bool test_int_shift_left_grows(void) {
WriteFmt("Testing IntShiftLeft\n");
Int value = IntFrom(3);- In
Int.Math.c:66:
Int value = IntFrom(3);
IntShiftLeft(&value, 4);
bool result = IntToU64(&value) == 48;- In
Int.Math.c:833:
bool test_int_shift_left_null(void) {
WriteFmt("Testing IntShiftLeft NULL handling\n");
IntShiftLeft(NULL, 1);- In
Int.Math.c:835:
WriteFmt("Testing IntShiftLeft NULL handling\n");
IntShiftLeft(NULL, 1);
return false;
}- In
Int.Type.c:46:
result = result && (IntToU64(&clone) == 11);
IntShiftLeft(&original, 1);
result = result && !IntEQ(&clone, &original);
Last updated on