Created
April 21, 2010 14:48
-
-
Save Kentzo/373901 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #define R 15 // исходные элементы - 15битные | |
| #define E 4 // 4 бита под экспоненты, так как 23 <= R < 24 | |
| // S[i] - беззнаковые числа | |
| for (i=0; i<N; i++) { // С каждым элементом исходного блока | |
| j=0; | |
| while (S[i] >= 1<<j) j++; // Найдем такое j, что S[i] < (1 << j) | |
| E[i]=j; // запишем j, т.е. порядок числа S[i] в массив E | |
| if (j>1) | |
| WriteBits(output, S[i], j-1); // запишем (j-1) младших бит числа S[i] в битовый блок с мантисаами | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment