Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^4: Decimal Floating Point (DFP) and does Perl needs DFP?

by flexvault (Monsignor)
on Jan 17, 2015 at 19:48 UTC ( [id://1113612]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Decimal Floating Point (DFP) and does Perl needs DFP?
in thread Decimal Floating Point (DFP) and does Perl needs DFP?

Hello syphilis,

Just a quick update. I went to this site and downloaded the code and successfully compiled using 'make -f Makefile.Linux' on a AMD server running Debian with gcc 4.4.5. It seems to contain the missing functions that you mentioned. I ran the sample, and it seems to work?????

~/dfpal# ./dfpsample 1.000001 60000 Version of DFPAL: 2.20 DFPAL is operating in software value of n4 = 9.000000000000000E+384 9E+384 * 9E+384 = Infinity 9E+384 * 9E+384 => Overflow DFPAL_TRP_INVALID is enabled! DFPAL_TRP_OVERFLOW is not enabled! DFPAL_TRP_INVALID is enabled! sign of n1 0 Zero value = 0 n1 is less than n2 n1 - n2 = -59998.999999 N1 - N2 = -59998.999999 original decimal64 n1=1.000001 minus n1 = -1.000001 It is still Overflow Now, it is not Overflow ~/dfpal#
Don't know what the sample is supposed to do, so your knowledge of the subject would be greatly appreciated to show some light. At least it's a start!

Regards...Ed

"Well done is better than well said." - Benjamin Franklin

Replies are listed 'Best First'.
Re^5: Decimal Floating Point (DFP) and does Perl needs DFP?
by syphilis (Archbishop) on Jan 18, 2015 at 01:56 UTC
    Just a quick update. I went to this site

    Yes, I've been there too - but haven't tried any of it out.
    I gather these are libraries that you link to if you want enhanced DFP coverage. The "decNumber" package appears to be software only, while DFPAL can tap into available hardware capabilities, falling back to decNumber where necessary.

    The mpfr home page links to decNumber, along with a link to what is presumably Intel's equivalent.
    And there's links there to a couple of other decimal packages - MathCW and mpdecimal.
    So there's plenty of additional chasing up to do for anyone so inclined :-)

    BTW, the original wiki page that you linked to contains a nice little atodecimal implementation that works for both _Decimal64 and _Decimal128.
    Unfortunately it won't evaluate 'inf', 'nan', or scientific notation inputs correctly and, by the time I add the perl code to accommodate that limitation, it probably won't be much faster than what I'm already doing.
    But I think I might use it anyway as it's cleaner than what I've presently got.

    Cheers
    Rob

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1113612]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2024-04-19 14:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found