uint.subbits.as.uint: Extract subbits from integer as unsigned int.

Description Usage Arguments Value Note

View source: R/subbit.R

Description

Extract bits start_index to stop_index from an 8 bit integer.

Usage

1
uint.subbits.as.uint(int8, start_index, stop_index)

Arguments

int8

integer, must be in range 0L..255L. The integer is of course stored as a 32 bit integer internally in R, but it must contain a value between 0 and 255, the other bits are ignored.

start_index

integer in range 1L..32L, the start bit index.

stop_index

integer in range 1L..32L, the stop bit index.

Value

an unsigned integer, the possible range depends on the number of bits.

Note

Thanks to Julian_Hn at stackoverflow for this function.


dfsp-spirit/pcx documentation built on Nov. 24, 2021, 5:29 p.m.