WIDTHOF Operator [INT]

The WIDTHOF operator returns the width of its operand in bits. For a variable, this width may be greater than the width of the variable's value if the variable was declared with an explicit width. See the documentation for the INT data type for a fuller discussion on declaring widths for variables.

INT a, b WIDTH 10, c WIDTH 10;

a := WIDTHOF(b * c);
// a = 20

c := 0;
a := WIDTHOF(c);
// a = 10