Mathtruncxb
Mathtruncxb is a hypothetical mathematical function used in fixed-point arithmetic to truncate a real number to a fixed-point representation specified by two width parameters, x and b. The function is defined for applications where a real input must be represented as a scaled integer with a fixed number of fractional bits, while constraining the overall word width.
Definition and parameters: For integers x ≥ 2 and b ≥ 0, mathtruncxb(r, x, b) produces an integer
Semantics and use: The function truncates toward zero, yielding a fixed-point representation whose error is less
Example: mathtruncxb(3.75, 4, 2) equals 15, representing 3.75 in a Q4.2 fixed-point format (since 15 / 2^2 =
Implementation notes: In practice, the operation is implemented as result = sign(r) × floor(|r| × 2^b) with