Skip to main content
added 130 characters in body
Source Link
Tbw
  • 2.2k
  • 2
  • 27
  1. Take its (big-endian) bit string and break off bits from the end equal to the number of zeros in the largest double power of two that can splitless than or equal to the bit string into two partsnumber.

  2. Use the name for the corresponding double power of two in the middle, and recursively name the left and right parts through the same procedure. If the left part is one, it is not spoken, and if the right part is zero, it is not spoken.

This system is similar to how we normally read numbers: 2004 -> 2 "thousand" 004 -> "two thousand four".

  1. Take its (big-endian) bit string and break off bits from the end equal to largest power of two that can split the bit string into two parts.

  2. Use the name for the corresponding double power of two in the middle, and recursively name the left and right parts through the same procedure. If the left part is one, it is not spoken, and if the right part is zero, it is not spoken.

  1. Take its (big-endian) bit string and break off bits from the end equal to the number of zeros in the largest double power of two less than or equal to the number.

  2. Use the name for the corresponding double power of two in the middle, and recursively name the left and right parts through the same procedure. If the left part is one, it is not spoken, and if the right part is zero, it is not spoken.

This system is similar to how we normally read numbers: 2004 -> 2 "thousand" 004 -> "two thousand four".

Became Hot Network Question
Fixed the big test case.
Source Link
Tbw
  • 2.2k
  • 2
  • 27
1 -> 1
2 -> 2
3 -> 21
4 -> 4
5 -> 41
6 -> 42
7 -> 421
8 -> 24
9 -> 241
10 -> 242
11 -> 2421
12 -> 214
25 -> H241
44 -> 2H214
100 -> 42H4
1000 -> 21B2142H24
4294967295 -> 21421H21421S21421H2142121421H21421B21421H21421S21421H21421B21421H21421
4294967296 -> I
1 -> 1
2 -> 2
3 -> 21
4 -> 4
5 -> 41
6 -> 42
7 -> 421
8 -> 24
9 -> 241
10 -> 242
11 -> 2421
12 -> 214
25 -> H241
44 -> 2H214
100 -> 42H4
1000 -> 21B2142H24
4294967295 -> 21421H21421S21421H21421
4294967296 -> I
1 -> 1
2 -> 2
3 -> 21
4 -> 4
5 -> 41
6 -> 42
7 -> 421
8 -> 24
9 -> 241
10 -> 242
11 -> 2421
12 -> 214
25 -> H241
44 -> 2H214
100 -> 42H4
1000 -> 21B2142H24
4294967295 -> 21421H21421B21421H21421S21421H21421B21421H21421
4294967296 -> I
Fixed the grammar
Source Link
Tbw
  • 2.2k
  • 2
  • 27

For example, 44 in binary is 101100. Split at four bits from the end and insert "hex", corresponding tomeaning \$2^4\$: 10 "hex" 1100. 10 becomes "two" and 1100 splits into 11 "four" 00, or "two one four". So the final number is "two hex two one four" or 2H214 in symbols (note that this is not the recommended way of writing numbers, just speaking).

For example, 44 in binary is 101100. Split at four bits from the end and insert "hex", corresponding to\$2^4\$: 10 "hex" 1100. 10 becomes "two" and 1100 splits into 11 "four" 00, or "two one four". So the final number is "two hex two one four" or 2H214 in symbols (note that this is not the recommended way of writing numbers, just speaking).

For example, 44 in binary is 101100. Split at four bits from the end and insert "hex", meaning \$2^4\$: 10 "hex" 1100. 10 becomes "two" and 1100 splits into 11 "four" 00, or "two one four". So the final number is "two hex two one four" or 2H214 in symbols (note that this is not the recommended way of writing numbers, just speaking).

edited tags
Link
Tbw
  • 2.2k
  • 2
  • 27
Loading
Source Link
Tbw
  • 2.2k
  • 2
  • 27
Loading