Equinox Online Help - Language Reference - A to Z
ShiftLeft |
|
---|---|
Applies to | |
Syntax | ShiftLeft(Item[,NumberOfShifts]) |
Action | Shift Item left NumberOf Shift times. Item is ulong. Bits at the high order end of the number are lost, and zero bits are added at the low order end. Practically speaking Number of shifts can be in the range -31 to +31 and default to +1. Negative values cause right shifts in a similar way. |
Scope | |
Notes | This command allows bit manipulation of 32 bit values. Additionally overflow checking in arithmatic using ulong numbers has been relaxed as overflow is a common technique for truncating high order bits. Note also that Equinox treats the AND and OR operators as binary operators while they are inside brackets. |
Category | Maths |
See Also | RotateLeft |
Example | This example prints the number 42 print ShiftLeft(21) This example prints the number 1 print ShiftLeft(0X800000000,-31) This example encodes two numbers using the XTEA encryption scheme. The encryption key is supplied in an array of 4 ulongs procedure XTEA ulong y, ulongz, ulong uKey[]ulong sumend procedure | XTEA This example decodes two numbers using the XTEA encryption system Procedure AETX ulong y, ulong z, ulong uKey[]ulong sumend procedure | AETX |