Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #135421

Re: Make double numbers notation more strict

From Krishna Myneni <krishna.myneni@ccreweb.org>
Newsgroups comp.lang.forth
Subject Re: Make double numbers notation more strict
Date 2026-08-25 10:41 -0500
Organization A noiseless patient Spider
Message-ID <116kd3q$3rc99$1@dont-email.me> (permalink)
References (1 earlier) <6a8ceb79$1@news.ausics.net> <116isf9$3bj1s$1@dont-email.me> <6a8d1763$1@news.ausics.net> <116js4d$3le16$1@dont-email.me> <6a8d7a71$1@news.ausics.net>

Show all headers | View raw


On 8/25/26 6:20 AM, dxf wrote:
> On 25/08/2026 8:51 pm, Krishna Myneni wrote:
>> On 8/24/26 11:17 PM, dxf wrote:
>>> On 25/08/2026 11:51 am, Krishna Myneni wrote:
>>>> On 8/24/26 8:10 PM, dxf wrote:
>>>>> On 24/08/2026 9:36 pm, albert@spenarnc.xs4all.nl wrote:
>>>>>> What does the Forth community think of the following:
>>>>>>
>>>>>> Now double numbers have to end with a '.' (c-notation).
>>>>>> Double precision numbers loose significance in the 64 bit era.
>>>>>> Time to de-emphasize this.
>>>>>> ...
>>>>>
>>>>> Moore said that about 32-bit (and double operators) back in '89 and
>>>>> still folks are finding uses.  Getting rid of doubles/input just to
>>>>> support floating-point which isn't even forth's niche (RPN and all that)
>>>>> ... seems so wrong.
>>>>>
>>>>
>>>> 1) Which Forth systems are getting rid of double length integer input?
>>>>
>>>> I originally did not implement double length integer input in kForth to avoid confusion with floating point. However, with the standardization of base prefixes, and with recognizers (though they are not needed for this), it became easy to implement an unambiguous form of input for double length numbers, requiring a base prefix character and a trailing decimal point e.g.
>>>>
>>>> #-170141183460469231731687303715884105728.
>>>> $ffffffffffffffffffffffffffffffff.
>>>> %10110001111011000101111.
>>>
>>> Interesting because ...
>>>
>>>     hex #23E1 decimal f. 230.  ok
>>>
>>> works on my system (but apparently not others)
>>> ...
>>
>> How is your example above relevant to interpreting double length integers?
> 
> It's not.  Though I did expect it to work on other forths.
> 

While the Forth 2012 standard does specify base prefix characters for 
the text interpreter when dealing with integers (3.4.1.3), it does not 
do so for text interpretation of floating point numbers:

12.3.7 Text interpreter input number conversion
If the Floating-Point word set is present in the dictionary and the 
current base is DECIMAL, the input number-conversion algorithm shall be 
extended to recognize floating-point numbers in this form:

Convertible string := <significand><exponent>
<significand> := [<sign>]<digits>[.<digits0>]
<exponent> := E[<sign>]<digits0>
<sign> := { + | - }
<digits> := <digit><digits0>
<digits0> := <digit>*
<digit> := { 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 }

...

If you want portable source for text input of floating point numbers, 
it's better to not use a base prefix for them.

>> What happens when you append a trailing decimal point to "#23E1"? Does your system still interpret it as a floating point number?
> 
> It's not recognized as any number.  # forces decimal interpretation.
> It fails as an integer/double due to 'E'.  It then fails as a float
> due to dp after the exponent.
> 

That's good. This is why I adopted the requirement of both the base 
prefix and trailing decimal point for source input of double length 
integers.

--
Krishna

Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Make double numbers notation more strict albert@spenarnc.xs4all.nl - 2026-08-24 13:36 +0200
  Re: Make double numbers notation more strict anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2026-08-24 14:44 +0000
  Re: Make double numbers notation more strict Stephen Pelc <stephen@vfxforth.com> - 2026-08-24 16:57 +0000
  Re: Make double numbers notation more strict dxf <dxforth@gmail.com> - 2026-08-25 11:10 +1000
    Re: Make double numbers notation more strict Paul Rubin <no.email@nospam.invalid> - 2026-08-24 18:25 -0700
      Re: Make double numbers notation more strict dxf <dxforth@gmail.com> - 2026-08-25 14:44 +1000
    Re: Make double numbers notation more strict Krishna Myneni <krishna.myneni@ccreweb.org> - 2026-08-24 20:51 -0500
      Re: Make double numbers notation more strict dxf <dxforth@gmail.com> - 2026-08-25 14:17 +1000
        Re: Make double numbers notation more strict Krishna Myneni <krishna.myneni@ccreweb.org> - 2026-08-25 05:51 -0500
          Re: Make double numbers notation more strict dxf <dxforth@gmail.com> - 2026-08-25 21:20 +1000
            Re: Make double numbers notation more strict Krishna Myneni <krishna.myneni@ccreweb.org> - 2026-08-25 10:41 -0500
              Re: Make double numbers notation more strict dxf <dxforth@gmail.com> - 2026-08-26 13:51 +1000
          Re: Make double numbers notation more strict albert@spenarnc.xs4all.nl - 2026-08-26 11:54 +0200
            Re: Make double numbers notation more strict albert@spenarnc.xs4all.nl - 2026-08-26 12:00 +0200
              Re: Make double numbers notation more strict antispam@fricas.org (Waldek Hebisch) - 2026-08-26 14:39 +0000
                Re: Make double numbers notation more strict anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2026-08-26 15:28 +0000
                Re: Make double numbers notation more strict peter <peter.noreply@tin.it> - 2026-08-26 18:42 +0200
                Re: Make double numbers notation more strict anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2026-08-26 17:04 +0000
                Re: Make double numbers notation more strict albert@spenarnc.xs4all.nl - 2026-08-27 12:43 +0200
        Re: Make double numbers notation more strict Hans Bezemer <the.beez.speaks@gmail.com> - 2026-08-26 09:12 +0200
    Re: Make double numbers notation more strict Hans Bezemer <the.beez.speaks@gmail.com> - 2026-08-26 09:15 +0200
  Re: Make double numbers notation more strict Hans Bezemer <the.beez.speaks@gmail.com> - 2026-08-26 09:09 +0200
    Re: Make double numbers notation more strict albert@spenarnc.xs4all.nl - 2026-08-26 12:22 +0200
      Re: Make double numbers notation more strict Hans Bezemer <the.beez.speaks@gmail.com> - 2026-08-26 19:40 +0200

csiph-web