Talk:Densely packed decimal

Cryptic Sentence
The proper way to parse this sentence isn't obvious to me. Could someone clarify? "For example, 38=12×3+2 decimal digits can be encoded in 12×10+7=127 bits." Sumguysr (talk) 07:34, 23 December 2011 (UTC)


 * 12 sets of three decimal digits can be encoded using 12 sets of 10 binary bits. The remaining two decimal digits can be encoded using 7 binary bits.  I'll add that to the article.  mfc (talk) 15:30, 31 December 2011 (UTC)

Chen-Ho encoding
Shouldn't the Chen-Ho encoding for 009 be 110 000 0001? --Wm243 (talk) 12:48, 17 April 2009 (UTC)
 * Indeed it should -- well spotted. (Fixed.) mfc (talk) 15:05, 17 April 2009 (UTC)

Yes, but what is it?
The article should explain how the scheme actually works. Superm401 - Talk 15:25, 11 November 2007 (UTC)


 * You're probably right. Suggestions?  mfc 15:52, 15 November 2007 (UTC)

Copyright
I also just realized many parts are identical to the original paper (http://speleotrove.com/decimal/DPDecimal.html), which says it's copyrighted by IBM. Superm401 - Talk 15:34, 11 November 2007 (UTC)


 * See the history of the page; I contributed the initial text for this page (on request), and I am also the author of the referenced paper and summary page and so it is my copyright. It is quite likely I used similar or identical words in the two places.  IBM has the use of the text, too, as does Wikipedia, but not exclusively.  mfc 15:51, 15 November 2007 (UTC)

Uses for the 24 redundant codes
Possible uses for the 24 redundant codes.
 * HIGH-VALUES: Not useful for arithmetic, but useful for sorting and for the initial value of "min".
 * LOW-VALUES: Like HIGH-VALUES, but a better initial value for "max".
 * +INFINITY: Note: HIGH-VALUES > +INFINITY
 * -INFINITY: Note: LOW-VALUES < -INFINITY
 * -0: "Negative zero", useful for meteorologists, is slightly less than 0, i.e., 0 - epsilon
 * +0: Slightly more than 0, i.e., 0 + epsilon.  For symmetry with -0.  The canonical zero can then be "exactly zero" which will kill the "numberness" of 1/x and ln x, etc.
 * NaN: Not a Number.
 * NaDPD: Not a Densely Packed Decimal.  Unicode has demonstrated the value of a "not one of mine" code, hasn't it?  It can serve as a separator, for example.  111 111 1 111 would be quite suitable.


 * ROUND-UP: Not so much a value as a flag for the DPD ALU (arithmetic-logic unit).
 * ROUND-DOWN: ditto
 * ROUND-TO-ZERO: ditto
 * ROUND-TO-EVEN: ditto
 * ROUND-TO-ODD: ditto
 * ROUNDING: A query to the PDP ALU to report its rounding mode with one of the codes above.    E.g. dpd old_rounding = 0 + ROUNDING; dpd new_rounding = 0 + ROUND-UP;

111 111 1 111 NaDCD 111 111 1 110 NaN ... mjk (talk) 22:50, 25 March 2008 (UTC)
 * OK, on further thought, it is strange to have negative values for a representation that is predestined for a sign-magnitude implementation. So forget about -INFINITY, +0, -0, and add:
 * EPSILON: which can be used by meteorologists, etc. with a sign, EPSILON replacing +0 and -EPSILON replacing -0.
 * CR: to explicitly indicate non-negatives, or "credits".
 * DB: to explicitly indicate negatives, or "debits".
 * mjk (talk) 13:03, 30 April 2008 (UTC)

Most applications won't use DPD for anything special beyond encoding decimal numbers. 24691358r (talk) 13:23, 20 May 2017 (UTC)
 * Let alone all of your suggested codes. 202.79.134.100 (talk) 08:42, 13 March 2018 (UTC)

Other bases
It's possible to have a similar system for other bases, for example storing 5 Ternary numeral system in a byte (3⁵=243 on 2⁸=256), as shown below:

where x means 0 or 1. Uses are for example densely storing an uncompressed 3–color image. 202.79.134.100 (talk) 08:42, 13 March 2018 (UTC)

Improve table for clarity
I don't know how to edit the table

That table could be more easy to read if the last column had the observation that a b3=0, b3=1 and b2b1<11 for just one 9-8 digit, b3=1 and b2b1=11 and b6b5<11 for two 9-8 digits, and b3=1 and b2b1=11 and b6b5=11 for three 9-8 digits.

something like:

$$b_3=0 \Rightarrow\text{all the } d_3,d_2,d_1 \text{ are } <8 $$ $$b_3=1\land b_2b_1<11 \Rightarrow \text{ just one } d_3,d_2,d_1 \text{ is } \ge 8$$ $$b_3=1\land b_2b_1=11 \land b_6b_5<11\Rightarrow \text{ just two of } d_3,d_2,d_1 \text{ are } <8$$ $$b_3=1\land b_2b_1=11 \land b_6b_5=11\Rightarrow \text{ all three } d_3,d_2,d_1 \text{ are } \ge 8$$

or

$$b_3b_2b_1=0xx \Rightarrow\text{all the } d_3,d_2,d_1 \text{ are } <8 $$ $$b_3=1\land b_2b_1<11 \Rightarrow \text{ just one } d_3,d_2,d_1 \text{ is } \ge 8$$ $$b_3b_2b_1=111 \land b_6b_5<11\Rightarrow \text{ just two of } d_3,d_2,d_1 \text{ are } <8$$ $$b_3b_2b_1=111 \land b_6b_5=11\Rightarrow \text{ all three } d_3,d_2,d_1 \text{ are } \ge 8$$

not all the lengthly text, maybe just the antecedent of the implication is needed.

Colors may also help. Is just a matter to do the changes to see what is visually more clear and aesthetic.

-- (unsigned) 2018-09-15T10:56:20‎ 2806:107e:c:f09:218:deff:fe2b:121