Method shr
shr(Int32, Int32)
Selects the value at index i relative to the top of the stack.
Shifts the numerator value to the right (in zeros) by the specified number of bits.
Declaration
public void shr(int c, int i = 0)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | c | The number of bits to shift. |
System.Int32 | i | A relative index of a stack entry. |
Remarks
Shifts the numerator value only, which is a fast alternative to divisions by powers of two.
Manipulating denominators is possible by calling inv(Int32) beforehand.
Inversion of rational 0 values (0 / 1 => 1 / 0) results in NaN values which can be ignored for all bit-level operations.