Bitwise Shift Right (>>)

23.08.2021

Shifts the bits in an integer to the right by the specified number of positions. The sign bit is propagated in the freed positions, i.e. the negative polarity sign is preserved.

Syntax

Expression >> Number

The syntax of the >> operator consists of the following elements:

Element

Description

Expression

Any expression. All integral data types are permitted.

Number

Same as Expression.

Remarks

Shifting one position to the right is the equivalent of dividing by 2.

All integral data types are permitted. If one argument is numerical and the other is a string, the string is changed to numerical type before the operation. Both arguments cannot be strings.

The operator can process scalar values or entire data series and data matrices. If at least one argument is a data series or a data matrix, the operation takes place on a per-element basis and the result is once again a data series or a data matrix. If at least one of the two arguments is a data matrix, then both arguments must have the same number of rows. For a different number of columns in data matrices or for a different number of rows in data series, extra columns or values are removed.

If signals, signal series or space curves are used, only their Y components are taken into consideration. The result then preferably contains the X component and possibly the Z component of Expression. Otherwise, it contains those of Number. If one of the expressions returns a list, then the operation is executed for each item in the list and the result is also a list.

The operator is left-associative, i.e. sequences of operations are processed from left to right.

Available in

FlexPro View, Basic, Professional, Developer Suite

Examples

8n >> 3n

Returns the 32-bit integer 1.

-8n >> 2n

Returns the 32-bit integer -2.

1n >> 1n

Returns the 32-bit integer 0.

 

See Also

Bitwise Shift Left (<<)

Share article or send as email:

You might be interested in these articles