Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re^2: floating point additionby syphilis (Archbishop) |
on Jan 12, 2015 at 23:35 UTC ( [id://1113010]=note: print w/replies, xml ) | Need Help?? |
It says that it is “implemented mostly in XS,” but I have not taken the time to see whether it uses microprocessor decimal-math I don't think it does, but it certainly does decimal (as opposed to binary) arithmetic - and should be more than adequate for most people wanting to perform base 10 arithmetic. OTOH, my Math::Decimal64 and Math::Decimal128 modules do make use of the _Decimal64 and _Decimal128 types, and associated operations: The user interface is a little awkward, mainly because gcc does not provide strtod64 or strtod128 functions, and does not provide any (s)printf formatters for the _Decimal64 and _Decimal128 type. I'm working on improving that interface - and the current git version provides for output in floating point format instead of just scientific notation (ie as 864.3 instead of 8643e-1 for the quoted example). I must also add overloading of strings - so that the above one liner can be rewritten as: But I don't want to add overloading of NVs as that would defeat the purpose. (That takes care of this month's quota of self-promotion ;-) Cheers, Rob
In Section
Seekers of Perl Wisdom
|
|