Jump to content

Talk:Binary-coded decimal

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by DavidCary (talk | contribs) at 19:36, 11 June 2022 (this phrase at the start of the article makes no sense: I agree). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.


implemented in all IBM mainframe hardware since then

The article says: implemented in all IBM mainframe hardware since then. For low-end S/360 models, decimal was optional. (As was floating point. Presumably one would get one or the other.) Also, the 360/91 doesn't have the decimal instructions, with the OS doing software emulation. (It has CVB and CVD, which are used in the emulation.) Gah4 (talk) 11:39, 6 August 2020 (UTC)[reply]

Rounding

The "Advantages" section says:

  • Addition and subtraction in decimal do not require rounding.

I am not sure what this is supposed to mean. If you're adding or subtracting two fixed-point numbers of the same precision, no rounding is required in any base. Though of course there's the possibility of overflow. If on the other hand you're adding or subtracting two floating-point numbers of the same precision, you need to round. For example, 2.3e0 + 5.1e-2 in decimal floating point should yield the rounded result 2.4e0. I will tag this point with dubious to encourage discussion. --Macrakis (talk) 19:02, 7 November 2021 (UTC)[reply]

this phrase at the start of the article makes no sense

"However, decimal fixed-point and floating-point formats are still important and continue to be used in financial, commercial, and industrial computing, where the subtle conversion and fractional rounding errors that are inherent in floating point binary representations cannot be tolerated."

floating point format is still used... where its its rounding errors cannot be tolerated? — Preceding unsigned comment added by 189.6.25.85 (talk) 13:05, 12 January 2022 (UTC)[reply]

IEEE 754 now supports float decimal formats, and IBM (at least) has implemented them in hardware. There is some suggestion that they are there for financial reasons, but I don't believe that is true. Fixed decimal, yes. According to Donald Knuth finance and typesetting should be done in fixed point. And yes some finance calculations depend on decimal rounding, though not hard to do in binary. Gah4 (talk) 22:27, 12 January 2022 (UTC)[reply]
I agree that sentence *sounds* like a self-contradition. It also *seems* to imply that "formats" are somehow different from "representations", although they are synonyms in this article.
I think this sentence was intended to distinguish between (as Gah4 points out) "decimal floating-point formats" vs. "binary floating-point formats", so I tried to clarify it to say something more like
"decimal floating-point formats are still ... used ... where ... errors that are inherent in binary floating point formats cannot be tolerated."
Other places in this article still seem to imply that "binary representations", "decimal representations", "decimal formats", "binary formats" are four different things. Would it make this article easier to understand if it (a) explicitly said "representation" is a synonym for "format" in this article, or (b) avoided ever using "representation", using "format" instead, or (c) avoid ever using "format", using "representation" instead? --DavidCary (talk) 19:36, 11 June 2022 (UTC)[reply]