🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.forth
Article #159

Re: Tests for (DDFS.)

#159
From: dxf
Date: Wed, 21 Oct 2026 03:23
43 lines
3253 bytes
On 21/10/2026 12:05 pm, Krishna Myneni wrote:
> On 10/20/26 7:15 PM, dxf wrote:
>> On 21/10/2026 4:26 am, marcel hendrix wrote:
>>> On 10/20/2026 6:15 PM, Krishna Myneni wrote:
>>>> On 10/20/26 8:47 AM, Krishna Myneni wrote:
>>>> ...
>>>>>
>>>>> ...
>>>>> The output shows that (DDFS.) as presently implemented in dd_io.4th fails for one of the test cases (test 2), and probably for many more cases.
>>>>> ...
>>>>
>>>> Typing the string outputs from (FS.) and (DDFS.) shows that (DDFS.) is not rounding properly.
>>> Simply setting the low part of a double double to 0 might be a bit too simplistic? Is the difference in the range of 1e-15 .. 1e-17 ?
>>
>> I wasn't aware any JVN packages performed rounding.  AFAIK some implementations
>> (yours?) limited numbers printed to PRECISION but that this was truncation - not
>> rounding.  Rounding presented a whole new problem - why I never attempted it.
>>
> 
> The present iteration of (DDFS.) in kForth's dd_io.4th includes some changes you introduced. I would have to back and check JVN's original code (which uses a state machine) to see it performs differently than the subroutine ddwrite() in Bailey's ddfun Fortran 90 package, which is what is used in my program dp2_to_dd.f90 (listed below).

The input routine had a different issue.  Debugging proved so onerous that I just
replaced the lot and it solved original problem.  In retrospect the issue was likely
due to the original's use of >FLOAT which split the conversion into two.  My routine
was the equivalent of a >DDFLOAT written from scratch.  The code proved simpler than
JVN's state machine >FLOAT thingy.

> 
> It is more productive to make (DDFS.) a Forth equivalent to ddwrite(), to provide the same performance.

I wouldn't know.  I've only ever considered my patches to JVN's DDFS. to be just that -
patches.  The 'peeldigit' routine should never produce 'negative digits' - but it does.
I've no idea how Bailey did things or whether JVN was cutting corners but the latter's
routine clearly had/has issues.
 
> What does your present version of (DDFS.) output on these tests?

As I consider my present DDFS. routine merely a 'sticky-taped' version of the original
that doesn't produce glaring errors, I don't hold it up as any solution.  The latter is
for others more interested than me to develop.

> ...
Technical Details
Message-ID: <6ad8303f$1@news.ausics.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!news.ausics.net!not-for-mail
References: <11b7rcu$31u3u$1@dont-email.me> <11b8427$35l54$1@dont-email.me> <11b887g$p2rm$1@dont-email.me> <6ad8043a$1@news.ausics.net> <11b935k$3gr0s$1@dont-email.me>

Show Full Headers
Complete Article Headers
Date: Wed, 21 Oct 2026 14:23:42 +1100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: Tests for (DDFS.)
Newsgroups: comp.lang.forth
References: <11b7rcu$31u3u$1@dont-email.me> <11b8427$35l54$1@dont-email.me>
 <11b887g$p2rm$1@dont-email.me> <6ad8043a$1@news.ausics.net>
 <11b935k$3gr0s$1@dont-email.me>
Content-Language: en-GB
From: dxf <dxforth@gmail.com>
In-Reply-To: <11b935k$3gr0s$1@dont-email.me>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
NNTP-Posting-Host: news.ausics.net
Message-ID: <6ad8303f$1@news.ausics.net>
Organization: Ausics - https://newsgroups.ausics.net
Lines: 43
X-Complaints: abuse@ausics.net
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!news.ausics.net!not-for-mail