On 10/16/2026 6:02 PM, Krishna Myneni wrote:
> On 10/16/26 10:36, marcel hendrix wrote:
>> On 10/16/2026 5:58 AM, Krishna Myneni wrote: >> >>  > extended precision (p = 64 bits) >>  > double double precision (p = 106 bits) >>  > quad precision (p = 113 bits) >>  > double extended precision (p = 128 bits) >>  > double quad precision (p = 226 bits) >>  > >>  > Then M = 70, and H >= 73 significant digits. >> >> Which implies H >= 83 for quad double extended precision, >> meaning the available QD* in that library is not sufficient. >> Although only QDNEGATE , qd=10 QD* , qd=10 QD/ , and QDF+ are needed, one can't get by with a bit shift routine and a simple QQDF+, as +/- INF, NAN and subnormals must be handled. >> >> Or give up in disgust and link to an external library. >> >> Either that or go for II.2. >> >> -marcel
> > > Yes, I expect QD* which I assume is quad double mulitply is probably not sufficient to handle quad extended requirements. One point I forgot to mention is that the Forth standard for REPRESENT requires rounding to nearest, in which case H_min = M (not M+3). There's no way I can see to avoid using big number arithmetic for the quad extended precision case.
An iForth QD library will have a quad double extended multiply QD* for 256 bits. Then -256e F2^x gives 8.6e-78 ~> 77 usable decimals. Your `2e FLOG 256e F* FCEIL F1+` formula (even rounding) gives M = 79, and unfortunately, QD* does not suffice.
> It's not hopeless. We have big number arithmetic library code in Forth with which to learn how to deal with just about any case. The learning curve is there, of course.
I don't know there is a Forth-based arbitrary *float* implementation, but the MPFR was ported back in 2012. I am looking at it just now. The Windows port suffered from a very immature MinGW64 and would need to be revisited. But why want QD, QX or QD when the mpfr gives arbitrary precision on its own? The charm of QD is that is very small and simple, while MPFR is a beast. It could be that it is much faster than QD/QX and QD though. Maybe some tests could be done first.
> To handle +/-INF and NAN, isn't it sufficient to examine the bit pattern for the leading extended precision number in the quad extended precision set i.e. no arithmetic should be needed to handle +/-INF and NAN? I'm not sure if subnormals will be more difficult to handle than normal numbers -- their precision is always less than or equal to normal numbers.
I hope that is true, I don't particularly enjoy looking into the MPFR again. -marcel