Jump to content

Talk:Binary-coded decimal/Archives/2024/February

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia


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)

I'm wondering if the original writer's intent was to say that "addition and subtraction in fixed-point as opposed to floating-point does not require rounding". If that's the case this bullet in the list should probably be removed. Like @Macrakis pointed out, that's a general statement about fixed-point vs floating-point and not specific to binary-coded decimal. Inquisitive Dev (talk) 06:56, 21 June 2022 (UTC)
It is a strange way to say it, and I wouldn't mind removing it. Note that many exact decimal fractions are repeating fractions in other bases. 0.1 is nice in decimal, but is rounded to the nearest value in a finite number of bits, in binary. Gah4 (talk) 19:49, 21 June 2022 (UTC)