I have code using two constants, each describing the size of an array in different ways:
const ArraySize = 1024;
ArrayBits = 10; //2^10 = 1024 bits
How do I express one of these in terms of the other? The compiler will not allow use of Log2 or LdExp in constants.
Answers for any version of Delphi are OK.
The value of a shl b is equal to a * 2^b, so 1 shl ArrayBits is equal to 2^ArrayBits.