Talk:Densely Packed Decimal

From Wikipedia, the free encyclopedia

(empty)

[edit] 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)

[edit] Copyright

I also just realized many parts are identical to the original paper (http://www2.hursley.ibm.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)

[edit] 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)