Skip to content

Instantly share code, notes, and snippets.

@timboudreau
Last active July 13, 2026 04:55
Show Gist options
  • Select an option

  • Save timboudreau/b3ffbf09950ed652b66354a11fd3f06c to your computer and use it in GitHub Desktop.

Select an option

Save timboudreau/b3ffbf09950ed652b66354a11fd3f06c to your computer and use it in GitHub Desktop.
Float to 24 bit sample table
(this is best viewed with a monospaced font):
Float32 Bits 24-bit-value Decibels Float-Bits
0.00 = 000000000000000000000000 0 = -160.00 dB 00000000000000000000000000000000
0.05 = 000001100110011001100110 419430 = -26.02 dB 00111101010011001100110011001101
0.10 = 000011001100110011001100 838860 = -20.00 dB 00111101110011001100110011001101
0.15 = 000100110011001100110011 1258291 = -16.48 dB 00111110000110011001100110011010
0.20 = 000110011001100110011001 1677721 = -13.98 dB 00111110010011001100110011001101
0.25 = 000111111111111111111111 2097151 = -12.04 dB 00111110100000000000000000000000
0.30 = 001001100110011001100110 2516582 = -10.46 dB 00111110100110011001100110011010
0.35 = 001011001100110011001100 2936012 = -9.12 dB 00111110101100110011001100110100
0.40 = 001100110011001100110011 3355443 = -7.96 dB 00111110110011001100110011001110
0.45 = 001110011001100110011001 3774873 = -6.94 dB 00111110111001100110011001101000
0.50 = 010000000000000000000000 4194304 = -6.02 dB 00111111000000000000000000000001
0.55 = 010001100110011001100110 4613734 = -5.19 dB 00111111000011001100110011001110
0.60 = 010011001100110011001101 5033165 = -4.44 dB 00111111000110011001100110011011
0.65 = 010100110011001100110011 5452595 = -3.74 dB 00111111001001100110011001101000
0.70 = 010110011001100110011010 5872026 = -3.10 dB 00111111001100110011001100110101
0.75 = 011000000000000000000000 6291456 = -2.50 dB 00111111010000000000000000000010
0.80 = 011001100110011001100110 6710886 = -1.94 dB 00111111010011001100110011001111
0.85 = 011011001100110011001101 7130317 = -1.41 dB 00111111010110011001100110011100
0.90 = 011100110011001100110011 7549747 = -0.92 dB 00111111011001100110011001101001
0.95 = 011110011001100110011010 7969178 = -0.45 dB 00111111011100110011001100110110
1.00 = 100000000000000000000000 8388608 = 0.00 dB 00111111100000000000000000000001
You'll notice that the bit pattern in the 24 bit int and 32 bit float is identical for the majority
of bits:
0.55: =
01 000110011001100110011 0 4613734 = -5.19 dB
001111110 000110011001100110011 10
0.8:
01 100110011001100110011 0 6710886 = -1.94 dB
001111110 100110011001100110011 11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment