Deutsch   English   Français   Italiano  
<a14794a0c4fafbe96161b6c336747a6212c226d4@i2pn2.org>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!weretis.net!feeder9.news.weretis.net!news.nk.ca!rocksolid2!i2pn2.org!.POSTED!not-for-mail
From: dxf <dxforth@gmail.com>
Newsgroups: comp.lang.forth
Subject: Re: FP number syntax
Date: Thu, 2 Jan 2025 00:20:53 +1100
Organization: i2pn2 (i2pn.org)
Message-ID: <a14794a0c4fafbe96161b6c336747a6212c226d4@i2pn2.org>
References: <f3d930ef062d020cd12825545af27eb8cccf9160@i2pn2.org>
 <0d58f9f2c2e7ce33f032cbda245a1eee4782552f@i2pn2.org>
 <874j2rpcl3.fsf@nightsong.com>
 <372725cbde75de8c5e4f86e726b42d159b3bba93@i2pn2.org>
 <87zfkinuvb.fsf@nightsong.com> <2024Dec26.225518@mips.complang.tuwien.ac.at>
 <87v7v6neim.fsf@nightsong.com> <2024Dec31.225135@mips.complang.tuwien.ac.at>
 <de87b7eda8b747dc2af39527cc81f37f9b106f02@i2pn2.org>
 <vl2djv$2etn5$1@dont-email.me>
 <f1177289a653abe2c0af3e0774e842218d5c5137@i2pn2.org>
 <2025Jan1.124716@mips.complang.tuwien.ac.at>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 1 Jan 2025 13:20:57 -0000 (UTC)
Injection-Info: i2pn2.org;
	logging-data="1496011"; mail-complaints-to="usenet@i2pn2.org";
	posting-account="XPw7UV90Iy7EOhY4YuUXhpdoEf5Vz7K+BsxA/Cx8bVc";
User-Agent: Mozilla Thunderbird
X-Spam-Checker-Version: SpamAssassin 4.0.0
In-Reply-To: <2025Jan1.124716@mips.complang.tuwien.ac.at>
Content-Language: en-GB
Bytes: 3097
Lines: 37

On 1/01/2025 10:47 pm, Anton Ertl wrote:
> dxf <dxforth@gmail.com> writes:
>> On 1/01/2025 2:42 pm, Bernd Linsel wrote:
>>> It's usually implemented that DPL is reset to -1 when entering >NUMBER,
>>> each successful digit conversion increments it only if it is >= 0, and the first decimal separator encountered changes it from -1 to 0.
>>
>> Yes, in Fig-Forth.  In Swiftforth DPL is just a flag.
> 
> SwiftForth x64-Linux 4.0.0-RC89 15-Jul-2024 
> 1 dpl ? -1023  ok
> 1.234 dpl ? 3  ok
> 12 dpl ? -1022  ok

My bad.  >NUMBER increments DPL but how/when appears to vary with implementation.
Also Kitt Peak Forth (1979) DPL is for output - not input!

> Apparently SwiftForth counts every digit starting with -1024, and "."
> setting the count to 0.  So for doubles the behaviour is the same as
> that of Gforth, and testing for dpl @ 0< identifies singles on both
> systems.  lxf and VFX behave like Gforth.
> 
> So systems that implement DPL implement it similarly enough that
> programs can determine the number of digits after the decimal point.
> 
> But does anybody actually make use of DPL?  I have not seen a single
> use, ever.  Is it just some feature that someone thought up and
> implemented, and we all continued to implement it because we could and
> it was traditional?

Since >NUMBER (and previous incarnations) all increment DPL such use must
have been originally envisioned.
 
> If there has been a use at some time, is there still?  I have not seen
> complaints about the non-standardization of DPL and the
> only-terminating decimal point in Forth-94 or Forth-2012.

Pulling DPL out of systems that currently use it might result in complaints.