- parseUnitValue(value: number): {
denominator: number;
numerator: number;
prefix: number;
reserved: number;
}
-
Returns {
denominator: number;
numerator: number;
prefix: number;
reserved: number;
}
-
denominator: number
-
numerator: number
-
prefix: number
-
reserved: number
Parses a 32-bit integer value into its individual components: prefix, numerator, denominator, and reserved.
Read ETG.1004 Unit specification for details.
This function takes a 32-bit signed integer
value
and extracts the following components:prefix
: The most significant byte (bits 24-31).numerator
: The second byte (bits 16-23).denominator
: The third byte (bits 8-15).reserved
: The least significant byte (bits 0-7).The function uses bitwise operations to isolate each byte from the 32-bit integer.
Returns
An object containing the extracted components:
prefix
: The extracted prefix byte (8 bits).numerator
: The extracted numerator byte (8 bits).denominator
: The extracted denominator byte (8 bits).reserved
: The extracted reserved byte (8 bits).