dec64 decimal floating point type

Alix Pexton alix.DOT.pexton at gmail.DOT.com
Mon Apr 14 11:08:36 PDT 2014


On 14/04/2014 10:44 AM, Francesco Cattoglio wrote:

> This would make sense, at least partially, if hardware supporting the
> ieee was non-existant, but apparently hardware support for the decimal64
> standard is already here!
>
> Being a numerical analyst I can say I'm extremely interested when
> someone comes up with new interesting ideas, but as far as I can tell we
> still need to go down a long road before finding something better than
> good old floats. And I really think that one should stick to the
> standards, as long as the standard is good enough.
>
> On a side note, I think that support for decimal64 might be something
> nice to have in the D language, because apparently that one is the most
> used floating point type in the economic sectors.

I did a little research, you are right, IBM has implemented the IEEE 
decimal floats in their Power6 and z9 chips (since 2007), and Sparc64 
chips have it too (since 2012). But the amount of silicon required to 
create these decimal FPUs is significantly greater than for binary FPUs 
(as the format is essentially a dense form of BCD) and this makes it 
very unlikely that they will ever make their way into desktop or mobile 
processors.

The Dec64 decimal float is not a form of BCD, which is part of the 
reason why it can be emulated in software in a significantly more 
efficient way than the IEEE standard. While no hardware design exists, 
this would suggest that it would require less silicon, giving a greater 
chance that it will get into non-mainframe hardware.

A while ago there was a proposal for a new decimal float format to be 
included in ECMAScript 4 but the resources for that proposal seem to 
have been purged ()I've only found a few broken links. But as Doug 
Crockford (who at least wrote the dec64 reference implementation if not 
conceived the whole design) is on the TC39 committee that works on the 
standards for ECMAScript, I assume that it is related to that proposal 
and might even become a part of ECMAscript standard in the future.

Doug is a competent and respected programmer and speaker (among other 
things, he "discovered" JSON), and I believe that he would not have 
begun this project if there were not a compelling reason to do so. I 
hope that I am not misrepresenting him any way.

I will endeavour to port the reference implementation solo as it will 
undoubtedly be educational, and also to find more evidence that the 
effort is worth my time! I'll gladly share both.

A...


More information about the Digitalmars-d mailing list