Rice coding: Difference between revisions
→{{header|Wren}}: Oops!
(→{{header|Wren}}: Updated in line with Julia and also added basic codings for k= 4.) |
(→{{header|Wren}}: Oops!) |
||
Line 177:
}
System.print("Basic Rice coding (k = 2):")
for (i in 0..10) {
var res = Rice.encode(i, 2)
Line 183:
}
System.print("\nExtended Rice coding (k == 2):")
for (i in -10..10) {
var res = Rice.encodeEx(i, 2)
Line 197:
{{out}}
<pre>
Basic Rice coding (k = 2):
0 ->
1 ->
2 ->
3 ->
4 ->
5 ->
6 ->
7 ->
8 ->
9 ->
10 ->
Extended Rice coding (k == 2):
-10 ->
-9 ->
-8 ->
-7 ->
-6 ->
-5 ->
-4 ->
-3 ->
-2 ->
-1 ->
0 ->
1 ->
2 ->
3 ->
4 ->
5 ->
6 ->
7 ->
8 ->
9 ->
10 ->
Basic Rice coding (k == 4):
|