Sujet : Re: Why dial-a-standard is not a thing in Forth
De : dxforth (at) *nospam* gmail.com (dxf)
Groupes : comp.lang.forthDate : 23. Apr 2025, 13:01:58
Autres entêtes
Organisation : i2pn2 (i2pn.org)
Message-ID : <eaf57910d5470b7f03d90820799e3fb611997353@i2pn2.org>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14
User-Agent : Mozilla Thunderbird
On 23/04/2025 8:21 pm, mhx wrote:
On Tue, 22 Apr 2025 0:50:13 +0000, dxf wrote:
On 22/04/2025 12:19 am, sjack wrote:
dxf <dxforth@gmail.com> wrote:
[..]
16 base ! 10 cvd decimal . 10 ok
2 base ! 10 cvd decimal . 10 ok
36 base ! -10 cvd decimal . -10 ok
Why not store the number as text in this case?
Where, when?
What is the advantage? As a user I still need
to know the BASE (unless it is assumed to be
always 10).
The context of the routine was that the user had already input a
number (i.e. it's on the stack) in a base possibly different from
decimal but needed the number interpreted as if it were decimal.
There are certainly limitations e.g. if I'm in hex and using a 16-bit
forth the maximum digits I can enter is 4. If I'm in octal I can't
enter '8' or '9'.