On 05/28/2017 12:04 PM, Elizabeth Mattijsen wrote:
On 28 May 2017, at 11:49, Marcel Timmerman <mt1...@gmail.com> wrote:
I've a question about naming a specific class. It is about the type Decimal128 
which I need in BSON. For the moment I want it to hold a number and in BSON to 
encode and decode it to a byte stream. Later I can add specific operations and 
other known decimal types. I am thinking of the following names;

Math::Decimal::D128
Math::Decimal::D64
Math::Decimal::D32

For the 128, 64 and 32 bit decimal types. Or should I drop the Math:: part.

The other question I have is the following; I know about the _Decimal128 type 
in C (gcc). Is it also a standard type in C on windows and mac? In that case I 
could try to go native.
Apart from the naming, isn’t Decimal64 the same as “num64” in Rakudo?  And 
Decimal32 the same as “num32” ?  If so, I think there’s already an outstanding 
RT for not supporting “num128” in Rakudo.  Perhaps it would be better to focus 
on supporting this in MoarVM directly?



Liz

Hi Liz,

I've understood that the representation is a bit different. The num* types are based on floating point layout and the decimal* is based on a densely packed decimal (a kind of packed BCD). For the 128 bit version it would represent 34 digits coefficient.

Still, when I get something running it could be a new type in moarvm later on (help is needed though to lead the way in moarvm).

Marcel

Reply via email to