Rice coding: Difference between revisions
Content added Content deleted
(Made this into a draft task and added a Wren example.) |
m (→{{header|Wren}}: Added colon.) |
||
Line 152: | Line 152: | ||
} |
} |
||
System.print("\nExtended Rice coding") |
System.print("\nExtended Rice coding:") |
||
for (i in -10..10) { |
for (i in -10..10) { |
||
var res = Rice.encodeEx(i, 2) |
var res = Rice.encodeEx(i, 2) |
||
Line 173: | Line 173: | ||
10 -> 110010 -> 10 |
10 -> 110010 -> 10 |
||
Extended Rice coding |
Extended Rice coding: |
||
-10 -> 11110011 -> -10 |
-10 -> 11110011 -> -10 |
||
-9 -> 11110001 -> -9 |
-9 -> 11110001 -> -9 |