Proposal for a standard Decimal type in alpha

rumbu rumbu at rumbu.ro
Sat Jan 13 11:12:48 UTC 2018


On Friday, 12 January 2018 at 15:44:01 UTC, Jack Stouffer wrote:
> On Thursday, 21 December 2017 at 13:59:28 UTC, Jack Stouffer 
> wrote:
>> ...
>
> While I believe my library has certain API advantages, I'm 
> really not interested in duplicating a bunch of work when 
> rumbu's version is pretty much complete, so I'm dropping this.

This is not good idea. Since your project is based on a BigInt 
storage, it will be the perfect candidate for a BigDecimal data 
type.

I explored also BigInt as storage for the decimal128 data type, 
but finally I ended writing my own fixed precision unsigned type 
in a recursive manner, mainly because of the BigInt dependency of 
the garbage collector. Internally, my decimal library is 
performing calculations on maximum 256 bits, so BigInt was more 
than I needed.

Also, your project is built mainly on IBM decimal concepts and 
mine on Intel's ones. During my exploration, I found that there 
is a cold war between IBM and Intel regarding the decimal 
standard (the main bone of contention being how to store digits). 
There are benchmarks on both parts (which obviously favor the 
benchmarker), but you cannot trust them. It will be nice to have 
both concepts in D and benchmark them independently.


More information about the Digitalmars-d-announce mailing list