This might imply increased precision on SPARC boxesIn many instances the 16 byte long double provides the same (64-bit) precision as the 12 byte variant ... and the same exponent range, too, I think.
But it's the double-double arrangement that enables contrived comparisons (such as the one I provided) to work.
It would take a data type providing 663 bits of precision to detect that
1.0 + 5e-200 > 1.0, whereas the double-double arrangement of the PowerPC long double stores 1.0 in one double and 5e-200 in the other. The processor then knows that the sum of both is greater than either of the 2 doubles because both doubles are positive and non-zero.
At least, that's how I surmise.
The processor cannot detect that
1.1 + 5e-200 > 1.1 because the "1.1" value gets written over both doubles - and adding 5e-200 then makes no difference to the 2 stored double values.
I was hoping that a
printf "%.200Le", ... of the
1.0 + 5e-200 value might print out the actual value of
1.00000...005 but, alas, doesn't even get close (in perl or C).
BTW, the "bitch" part is that, with certain values, you can get rounding errors if you try to print out more than 15 decimal digits of precision (in perl or C).
All in all, an intriguing arrangement - and one that almost works beautifully.
Cheers,
Rob
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.