in reply to Re^8: Defining an XS symbol in the Makefile.PL
in thread Defining an XS symbol in the Makefile.PL
Do the different long double types have differing ranges?
Yes, but we don't need to know anything about the range for the task at hand.
We just need to know the maximum number of bits of precision for each type, and the number of decimal digits required to accurately handle each of those maximum precisions.
That is:
53 bits needs 17 decimal digits
64 bits needs 21 decimal digits
113 bits needs 36 decimal digits
The DoubleDouble can actually accommodate some (not all) 2098bit values  which would require 633 decimal digits, but I'm still pondering what should be done about that.
I doubt that"%.632" NVgf will produce reliable results anyway.
Unpacking the bytes of the NV is probably cheaper and quicker than obtaining a numeric value, so maybe that's a better path to take for *all* NVs  not just the DoubleDouble.
Cheers,
Rob
Yes, but we don't need to know anything about the range for the task at hand.
We just need to know the maximum number of bits of precision for each type, and the number of decimal digits required to accurately handle each of those maximum precisions.
That is:
53 bits needs 17 decimal digits
64 bits needs 21 decimal digits
113 bits needs 36 decimal digits
The DoubleDouble can actually accommodate some (not all) 2098bit values  which would require 633 decimal digits, but I'm still pondering what should be done about that.
I doubt that"%.632" NVgf will produce reliable results anyway.
Unpacking the bytes of the NV is probably cheaper and quicker than obtaining a numeric value, so maybe that's a better path to take for *all* NVs  not just the DoubleDouble.
Cheers,
Rob


Replies are listed 'Best First'.  

Re^10: Defining an XS symbol in the Makefile.PL
by jcb (Chaplain) on Aug 19, 2019 at 22:33 UTC  
by syphilis (Bishop) on Aug 20, 2019 at 07:27 UTC 
In Section
Seekers of Perl Wisdom