Multiply, Return High '**', '**='

This operator is also called Multiply-High. It can be used in both variable and integer constant expressions, but not in floating-point constant expressions. Multiply High multiplies two values together and returns the upper 32 bits of the 64-bit result. Example:

X := Y ** 8

If Y started out as 536,870,912 (229) then Y ** 8 equals 1; the value in the upper 32 bits of the result.

Multiply-High has an assignment form, **=, that uses the variable to its left as both the first operand and the result destination. For example,

X **= 20  'Short form of X := X ** 20

Here, the value of X is multiplied by 20 and the upper 32 bits of the result is stored back in X. The assignment form of Multiply-High may also be used within expressions for intermediate results; see Intermediate Assignments.

Unless otherwise noted, content on this site is licensed under the
Creative Commons Attribution-ShareAlike 4.0 International License.