|
Extracts bits from a number.
syntax
CBit(
val,
pos
[, size = 1]
)
Parameters
val
|
|
Type:
|
Number
|
|
The base value to convert bits to. Arrays can be specified.
|
pos
|
|
Type:
|
Number
|
|
Bit number position (0 to 31). For example, to get the 3rd bit, specify 3. Arrays can be specified.
|
size
|
|
Type:
|
Number
|
|
Bit size (1 to 32). For example, if you want to get 3 bits from pos, specify 3. Arrays can be specified.
|
Return Value
|
|
Type:
|
Number
|
|
The bit-extracted number.
|
Explanation
Extracts a bit from a specified bit number of a number and returns the result as a number.
|
Supported
reference
CBool
CNum
CStr
CBit
CTime
CScript
CScriptTo
CNumStr (NS)
CTimeStr (TS)
CTimeSpanStr
CDurationStr
CNumToHex
CNumToOct
CNumToBin
CNumToExp
CHexToNum
COctToNum
CBinToNum
CNumToComma
CCommaToNum
CLinearToPf
CPfToLinear
CTable
CValidTable
|