2

IEEE 754-2008 added storage formats for decimal floating-point numbers, i.e. floating-point numbers with a radix of 10 instead of 2. IEEE 854 already defined operations on these kinds of numbers, but without a storage format, and it never saw adoption.

I'd be interested in knowing what use cases the standards committee might have had in mind when adopting these storage formats and associated operations into the standard. I have a hard time coming up with use cases for either.

The only source that I could find that tries to grasp at some straws is this: Intel and Floating-Point states:

Decimal arithmetic also provides a robust, reliable framework for financial applications that are often subject to legal requirements concerning rounding and precision of the results in the areas of banking, telephone billing, tax calculation, currency conversion, insurance, or accounting in general.

I mean, come on. That's definitely not the case. A financial applications can't use numbers with rounding behavior that changes depending on the size of the number. All the tax law I know (and I know some), requires that numbers are rounded to a fixed number of digits when calculating tax, regardless of the magnitude of the amounts (e.g. 2 digits for VAT and 0 digits for income tax in ). Supporting this is the fact that DB engines generally provide fixed-point types for decimal numbers (e.g. SQL Server's MONEY or PostgreSQL's numeric).

So my question is: Is there any industry, technology, company etc. that makes use of decimal floating-point numbers?

Feuermurmel
  • 9,490
  • 10
  • 60
  • 90
  • To the best of my knowledge, IBM and in particular their senior researcher Mike Cowlishaw were the driving force behind the addition of decimal floating-point artihmetic to IEEE-754. IBM has also invested in hardware support for decimal floating point (and fixed point), initially with the System z11 line of mainframes. Steven Carlough, et al., "The IBM zEnterprise-196 Decimal Floating-Point Accelerator," In *20th IEEE Symposium on Computer Arithmetic*, 2011. From abstract: "Decimal floating-point Arithmetic is widely used in commercial computing applications, such as financial transactions,.." – njuffa Jun 04 '22 at 16:06
  • Yeah, that sounds like commercials for HDMI cables with silver leads. I'm not buying it. I've seen that sentence copied from publication to publication many times, never with a concrete source like a customer or application name or a concrete example where this kind of arithmetic is actually applicable. – Feuermurmel Jun 04 '22 at 17:25
  • 1
    If it helps for your peace of mind, why not assume that there is a dark secret behind the addition of DFP and that IBM cannot reveal the real reason they are expending all this effort and spending all that money on support for DFP. I noticed a typo in my previous comment: the *z10* line added hardware for DFP. FWIW, I consider this question off-topic for Stackoverflow as it is not about programming. – njuffa Jun 04 '22 at 17:41
  • 1
    I'd guess the only reason is to avoid all these nasty "why in your system 0.1*3 not equal 0.3??? fix immediately!" After customers got satisfied, machine developers could start teaching them how to use arithmetic properly... – Netch Jun 13 '22 at 20:36

0 Answers0