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


Groups > comp.lang.forth > #135330

Re: E.P E. E.EXACT

From anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups comp.lang.forth
Subject Re: E.P E. E.EXACT
Date 2026-08-10 17:24 +0000
Organization Institut fuer Computersprachen, Technische Universitaet Wien
Message-ID <2026Aug10.192409@mips.complang.tuwien.ac.at> (permalink)
References (5 earlier) <6a752ecb$1@news.ausics.net> <2026Aug7.121124@mips.complang.tuwien.ac.at> <6a76b305$1@news.ausics.net> <2026Aug8.083201@mips.complang.tuwien.ac.at> <6a777a5b@news.ausics.net>

Show all headers | View raw


dxf <dxforth@gmail.com> writes:
>On 8/08/2026 4:32 pm, Anton Ertl wrote:
>> dxf <dxforth@gmail.com> writes:
>>> On 7/08/2026 8:11 pm, Anton Ertl wrote:
>>>> F. produces output that cannot be cut and pasted into the text
>>>> interpreter.  
>>>
>>> That may be but has nothing to do with F. which outputs classic fixed-
>>> point notation.
>> 
>> Given that it is a statement about F., it obviously has to do with F.
>
>Only if F. had a responsibility to the text interpreter.  It doesn't.

Sure, but that's one more reason not to use it, and use E. instead.

>I know what my F. prints.  I don't know what another's F. prints.
>That's what a standard is meant to sort out.

Given that well-reputed Forth systems deviate even from what the
standard specifies, that seems to be the position of an insignificant
minority.  The rest just does not care about the format and precision
of the F. output, or at least not for what the standard specifies for
it.

>> |An ambiguous condition exists if [...] the character string
>> |representation exceeds the size of the pictured numeric output string
>> |buffer.
>> 
>> So F. working for 1e300 or 1e-300 is not guaranteed.
>
>If printing 1e300 with F. was in any way the norm, I imagine ANS would
>have guaranteed it.

Maybe they had that in mind as escape hatch: With 32-bit cells
(considered large when Forth-94 was designed) the pictured numeric
output buffer shall be at least 66 chars, so printing any FP number
that requires more chars would be ambigous (for 16-bit cells already
at 34 chars).  And in that case, the Forth system can do something
more practical, such as outputting the number in scientific notation.

With 64-bit cells and a PNO buffer >=130 chars, the practicality of
this escape hatch is doubtful, however.

>From the examples you've shown,
>E.P has used precision values well short of the 800 used by E.EXACT.

r E. already outputs a number within 0.5 epsilon of r.  Printing
anything longer only makes sense if you want to print r exactly.  And
that mainly makes sense to demonstrate which numbers binary FP can
represent exactly, and what becomes of the numbers that cannot be
represented exactly.

So I don't see a point for any p between what E. uses (p<=17) and what
E.EXACT uses (p=800 for binary64 (IEEE DP)).  But you may want shorter
output (at the expense of less precision), then you use E.P with a
smaller p than E. uses.

About demonstrations, here's one:

0.1e e.exact \ .1000000000000000055511151231257827021181583404541015625e ok
\ now produce the next-smaller FP value: \ ok
0.1e pad f! -1 pad +! pad f@ \ ok f:1
\ and print it \ ok f:1
e.exact \ .09999999999999999167332731531132594682276248931884765625e ok

If we compare these numbers:

.1000000000000000055511151231257827021181583404541015625e
.09999999999999999167332731531132594682276248931884765625e

we see that the former is closer to 0.1 than the latter.

>It appears E.P's target is the same as G.R in VFX i.e. numbers
>printed at a precision no greater than the nominal precision of the
>floats involved.

G.R provides fixed-length output and is therefore more along the lines
of F.RDP.  G.R and G. also does not guarantee numbers that can be
pasted into the text interpreter.

>I don't think there's enough detail in ANS to say something is a bug.

There definitely is, otherwise I would not have been able to point out
bugs.

- anton
-- 
M. Anton Ertl  http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
     New standard: https://forth-standard.org/
EuroForth 2026 CFP: http://www.euroforth.org/ef26/cfp.html

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


Thread

E.P E. E.EXACT anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2026-08-05 18:02 +0000
  Re: E.P E. E.EXACT Krishna Myneni <krishna.myneni@ccreweb.org> - 2026-08-06 08:13 -0500
    Re: E.P E. E.EXACT anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2026-08-06 14:00 +0000
      Re: E.P E. E.EXACT Krishna Myneni <krishna.myneni@ccreweb.org> - 2026-08-06 10:45 -0500
        Re: E.P E. E.EXACT anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2026-08-06 15:58 +0000
          Re: E.P E. E.EXACT anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2026-08-06 17:20 +0000
        Re: E.P E. E.EXACT marcel hendrix <mhx@iae.nl> - 2026-08-06 21:05 +0200
          Re: E.P E. E.EXACT anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2026-08-06 20:38 +0000
          Re: E.P E. E.EXACT Krishna Myneni <krishna.myneni@ccreweb.org> - 2026-08-06 18:44 -0500
          Re: E.P E. E.EXACT dxf <dxforth@gmail.com> - 2026-08-07 11:03 +1000
            Re: E.P E. E.EXACT anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2026-08-07 10:11 +0000
              Re: E.P E. E.EXACT dxf <dxforth@gmail.com> - 2026-08-08 14:39 +1000
                Re: E.P E. E.EXACT anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2026-08-08 06:32 +0000
                Re: E.P E. E.EXACT dxf <dxforth@gmail.com> - 2026-08-09 04:50 +1000
                Re: E.P E. E.EXACT dxf <dxforth@gmail.com> - 2026-08-10 20:01 +1000
                Re: E.P E. E.EXACT anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2026-08-10 18:06 +0000
                Re: E.P E. E.EXACT anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2026-08-10 17:24 +0000
                Re: E.P E. E.EXACT dxf <dxforth@gmail.com> - 2026-08-11 14:01 +1000
                Re: E.P E. E.EXACT Krishna Myneni <krishna.myneni@ccreweb.org> - 2026-08-10 22:10 -0500
                Re: E.P E. E.EXACT anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2026-08-11 04:56 +0000
                Re: E.P E. E.EXACT Krishna Myneni <krishna.myneni@ccreweb.org> - 2026-08-11 22:16 -0500
                Re: E.P E. E.EXACT Krishna Myneni <krishna.myneni@ccreweb.org> - 2026-08-12 05:47 -0500
                Re: E.P E. E.EXACT peter <peter.noreply@tin.it> - 2026-08-12 18:03 +0200
                Re: E.P E. E.EXACT Krishna Myneni <krishna.myneni@ccreweb.org> - 2026-08-12 11:48 -0500
                Re: E.P E. E.EXACT marcel hendrix <mhx@iae.nl> - 2026-08-08 09:14 +0200
                Re: E.P E. E.EXACT anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2026-08-08 09:40 +0000
                Re: E.P E. E.EXACT marcel hendrix <mhx@iae.nl> - 2026-08-08 15:26 +0200
                Re: E.P E. E.EXACT anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2026-08-10 16:43 +0000
                Re: E.P E. E.EXACT dxf <dxforth@gmail.com> - 2026-08-09 13:43 +1000
                Re: E.P E. E.EXACT marcel hendrix <mhx@iae.nl> - 2026-08-09 07:19 +0200
                Re: E.P E. E.EXACT dxf <dxforth@gmail.com> - 2026-08-10 19:15 +1000
                Re: E.P E. E.EXACT marcel hendrix <mhx@iae.nl> - 2026-08-10 13:17 +0200
                Re: E.P E. E.EXACT dxf <dxforth@gmail.com> - 2026-08-10 22:59 +1000
                Re: E.P E. E.EXACT dxf <dxforth@gmail.com> - 2026-08-10 23:54 +1000
                Re: E.P E. E.EXACT marcel hendrix <mhx@iae.nl> - 2026-08-10 20:42 +0200
                Re: E.P E. E.EXACT dxf <dxforth@gmail.com> - 2026-08-11 17:10 +1000
                Re: E.P E. E.EXACT dxf <dxforth@gmail.com> - 2026-08-12 14:04 +1000
                Re: E.P E. E.EXACT albert@spenarnc.xs4all.nl - 2026-08-22 16:43 +0200
                Re: E.P E. E.EXACT anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2026-08-22 15:47 +0000
                Re: E.P E. E.EXACT albert@spenarnc.xs4all.nl - 2026-08-22 18:27 +0200
                Re: E.P E. E.EXACT anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2026-08-22 16:40 +0000
                Re: E.P E. E.EXACT albert@spenarnc.xs4all.nl - 2026-08-22 19:42 +0200
                Re: E.P E. E.EXACT anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2026-08-22 18:03 +0000
                Re: E.P E. E.EXACT albert@spenarnc.xs4all.nl - 2026-08-22 22:56 +0200
                Re: E.P E. E.EXACT marcel hendrix <mhx@iae.nl> - 2026-08-23 00:50 +0200
                Re: E.P E. E.EXACT dxf <dxforth@gmail.com> - 2026-08-23 12:25 +1000
                Re: E.P E. E.EXACT Hans Bezemer <the.beez.speaks@gmail.com> - 2026-08-09 14:52 +0200
            Re: E.P E. E.EXACT Krishna Myneni <krishna.myneni@ccreweb.org> - 2026-08-07 07:50 -0500
              Re: E.P E. E.EXACT dxf <dxforth@gmail.com> - 2026-08-08 12:33 +1000
                Re: E.P E. E.EXACT albert@spenarnc.xs4all.nl - 2026-08-22 17:01 +0200
          Re: E.P E. E.EXACT albert@spenarnc.xs4all.nl - 2026-08-22 16:15 +0200

csiph-web