Q Format Converter

Float ==> Q

Float Input Qm.n: m Qm.n: n Q value

Q ==> Float

Q Input Qm.n: m Qm.n: n Float value

What is Q Format?

Q format is a fixed point way to store floating point (decimal) numbers in a computer program. It represents the decimal number as a fraction; storing both the numerator and denominator in single number using a set amount of bits. In the notation Qm.n, m and n represent the number of bits used to store the numerator and denominator, respectively. For example, the format Q4.12 uses 4 bits for the numerator and 12 bits for the denominator; for a total of 16 bits which can be stored in an int16_t type in C. The denominator is always a power of 2, so in our Q4.12 example the denominator is 4096, since 212=4096. Q format is useful on systems which lack real floating point support, such as the Playstation 1 :)

<-- Back to Home