Deutsch   English   Français   Italiano  
<66ac86be$1@news.ausics.net>

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

Date: Fri, 2 Aug 2024 17:11:57 +1000
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: History of CREATE...DOES> ?
Newsgroups: comp.lang.forth
References: <2024Jul25.141725@mips.complang.tuwien.ac.at>
 <66a26d3b$1@news.ausics.net> <2024Jul26.091303@mips.complang.tuwien.ac.at>
 <66a392ee$1@news.ausics.net> <2024Aug1.154846@mips.complang.tuwien.ac.at>
 <66ac5e0a$1@news.ausics.net>
 <17b1f2dc7b926ec8cb0ad635b6ae81a8@www.novabbs.com>
Content-Language: en-GB
From: dxf <dxforth@gmail.com>
In-Reply-To: <17b1f2dc7b926ec8cb0ad635b6ae81a8@www.novabbs.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
NNTP-Posting-Host: news.ausics.net
Message-ID: <66ac86be$1@news.ausics.net>
Organization: Ausics - https://newsgroups.ausics.net
Lines: 60
X-Complaints: abuse@ausics.net
Path: ...!weretis.net!feeder9.news.weretis.net!news.bbs.nz!news.ausics.net!not-for-mail
Bytes: 2528

On 2/08/2024 4:27 pm, minforth wrote:
> Really? With
> 
> SET-PRECISION / PRECISION ...
> Return the number of significant digits currently used
> by F.
> 
> and with
> 
> F. ...
> Display, with a trailing space, the top number on the
> floating-point stack using fixed-point notation:
>  [-] ⟨digits⟩.⟨digits0⟩

Fixed-point notation conventionally means decimal places.  Here's the spec
from BASIS 17:

   12.1.0084 (F.) "Paren-f-dot-paren"

   ( -- c-addr u )( F: r -- ) or ( r -- c-addr u )

   Convert the top number on the floating-point stack to its character
   string representation using fixed point notation:

   [-] <digit>.<digits0>

   The number of digits after the decimal point is determined by PLACES.

That clearly tells how many decimal places to print.  There is no equivalent
to PLACES in ANS.

Here's the example ANS gave:

   A.12.6.1.1427 F.
  For example, 1E3 F. displays 1000.

Let's try it on several forths:

SwiftForth i386-Win32 3.11.9-RC1 01-Sep-2022
3 set-precision  ok
1e3 f. 1000.  ok
10 set-precision  ok
1e3 f. 1000.000000  ok

Gforth 0.7.9_20200709
3 set-precision  ok
1e3 f. 1000.  ok
10 set-precision  ok
1e3 f. 1000.  ok

MinForth V3.4.8 - 32 bit
# 3 set-precision   ok
# 1e3 f.  1.E3  ok
# 10 set-precision  ok
# 1e3 f.  1000.  ok

Arguably MinForth isn't compliant as it drops to scientific notation.  The
other two, despite displaying differently, are harder to dismiss.  I believe
iForth treats PRECISION as decimal places, so that's another variation.