Re: FP number syntax

Liste des GroupesRevenir à cl forth 
Sujet : Re: FP number syntax
De : dxforth (at) *nospam* gmail.com (dxf)
Groupes : comp.lang.forth
Date : 01. Jan 2025, 01:45:27
Autres entêtes
Organisation : i2pn2 (i2pn.org)
Message-ID : <de87b7eda8b747dc2af39527cc81f37f9b106f02@i2pn2.org>
References : 1 2 3 4 5 6 7 8 9 10 11
User-Agent : Mozilla Thunderbird
On 1/01/2025 8:51 am, Anton Ertl wrote:
Paul Rubin <no.email@nospam.invalid> writes:
anton@mips.complang.tuwien.ac.at (Anton Ertl) writes:
<https://forth-standard.org/standard/double#subsection.8.3.1>
>
Aha, thanks.  Similarly 8.3.2 for DPANS94.  Oddly, in gforth, "123.45"
pushes 12345 0.  I can understand "123." is a number (123) followed by a
decimal point, but I'd expect the 45 to either be invalid or another
number, giving 123 0 45.
 
Traditionally, Forth has used the syntax 123.45 for fixed-point
numbers.  You get the same number on the stack as with the standard
"12345.", and in addition, the (user) variable DPL is set to indicate
the position of the decimal point.  I have no idea how this crude way
was used in practice, but in any case, Gforth implements this feature.

It's possible this came from Kitt Peak Forth (on which Forth-77 was based)
and picked up by Fig-forth.  'Starting Forth' (Forth Inc) supported
'embedded punctuation' - a range of characters including / # etc to simulate
various formatting e.g. time and date.

 
The Forth-94 standardizers were apparently less convinced, so they
standardized neither numbers with an embedded decimal point, nor DPL.

To support DPL I have >NUMBER increment it for every digit successfully
converted.  While most systems today have DPL (?) usage is probably too
diverse to standardize.


Date Sujet#  Auteur
8 Dec 24 * ANN: DX-Forth 4.5756dxf
9 Dec 24 `* Re: ANN: DX-Forth 4.5755Hans Bezemer
10 Dec 24  +* Re: ANN: DX-Forth 4.575dxf
10 Dec 24  i+- Re: ANN: DX-Forth 4.571albert
10 Dec 24  i`* Re: ANN: DX-Forth 4.573albert
10 Dec 24  i `* Re: ANN: DX-Forth 4.572dxf
11 Dec 24  i  `- Re: ANN: DX-Forth 4.571dxf
24 Dec 24  `* Re: ANN: DX-Forth 4.5749John
24 Dec 24   `* Re: ANN: DX-Forth 4.5748dxf
25 Dec 24    `* Re: ANN: DX-Forth 4.5747John
25 Dec 24     +* Re: ANN: DX-Forth 4.5745dxf
25 Dec 24     i`* FP number syntax (was: ANN: DX-Forth 4.57)44Anton Ertl
25 Dec 24     i +* Re: FP number syntax42minforth
26 Dec 24     i i`* Re: FP number syntax41dxf
26 Dec 24     i i +* Re: FP number syntax39Paul Rubin
26 Dec 24     i i i+* Re: FP number syntax36dxf
26 Dec 24     i i ii+* Re: FP number syntax30Paul Rubin
26 Dec 24     i i iii+* Re: FP number syntax2minforth
27 Dec 24     i i iiii`- Re: FP number syntax1dxf
26 Dec 24     i i iii`* Re: FP number syntax27Anton Ertl
27 Dec 24     i i iii +- Re: FP number syntax1dxf
27 Dec 24     i i iii +* Re: FP number syntax17Paul Rubin
27 Dec 24     i i iii i+* Re: FP number syntax5mhx
27 Dec 24     i i iii ii`* Re: FP number syntax4minforth
27 Dec 24     i i iii ii `* Re: FP number syntax3albert
27 Dec 24     i i iii ii  `* Re: FP number syntax2minforth
28 Dec 24     i i iii ii   `- Re: FP number syntax1albert
31 Dec 24     i i iii i`* Re: FP number syntax11Anton Ertl
1 Jan 25     i i iii i `* Re: FP number syntax10dxf
1 Jan 25     i i iii i  `* Re: FP number syntax9Bernd Linsel
1 Jan 25     i i iii i   `* Re: FP number syntax8dxf
1 Jan 25     i i iii i    +- Re: FP number syntax1dxf
1 Jan 25     i i iii i    `* Re: FP number syntax6Anton Ertl
1 Jan 25     i i iii i     +- Re: FP number syntax1HenryHH
1 Jan 25     i i iii i     `* Re: FP number syntax4dxf
1 Jan 25     i i iii i      +* Re: FP number syntax2mhx
1 Jan 25     i i iii i      i`- Re: FP number syntax1albert
1 Jan 25     i i iii i      `- Re: FP number syntax1dxf
27 Dec 24     i i iii `* Re: FP number syntax8albert
28 Dec 24     i i iii  +- Re: FP number syntax1dxf
31 Dec 24     i i iii  `* Re: FP number syntax6Anton Ertl
2 Jan 25     i i iii   `* Re: FP number syntax5Anton Ertl
3 Jan 25     i i iii    `* Re: FP number syntax4albert
3 Jan 25     i i iii     `* Re: FP number syntax3Anton Ertl
4 Jan 25     i i iii      +- Re: FP number syntax1minforth
4 Jan 25     i i iii      `- Re: FP number syntax1albert
3 Jan 25     i i ii`* Re: FP number syntax5dxf
3 Jan 25     i i ii +* Re: FP number syntax2minforth
3 Jan 25     i i ii i`- Re: FP number syntax1dxf
3 Jan 25     i i ii `* Re: FP number syntax2Anton Ertl
3 Jan 25     i i ii  `- Re: FP number syntax1minforth
26 Dec 24     i i i`* Re: FP number syntax2Anton Ertl
26 Dec 24     i i i `- Re: FP number syntax1dxf
26 Dec 24     i i `- Re: FP number syntax1mhx
25 Dec 24     i `- Re: FP number syntax (was: ANN: DX-Forth 4.57)1albert
26 Dec 24     `- Re: ANN: DX-Forth 4.571dxf

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal