Article View: comp.lang.forth
Article #88Re: FCONSTANT specification
From: Krishna Myneni
Date: Fri, 16 Oct 2026 03:58
Date: Fri, 16 Oct 2026 03:58
93 lines
5008 bytes
5008 bytes
On 10/14/26 8:40 PM, dxf wrote:
> On 14/10/2026 7:25 pm, Anton Ertl wrote:
>> albert@spenarnc.xs4all.nl writes:
>>> The illusion that you can do something precise with imprecise numbers ...
>>
>> What is an "imprecise number"? In any case, every FP number has a
>> precise value. It may not be the value you are interested in, but
>> that does not make the value any less precise. And thinking about FP
>> numbers as "imprecise" or intervals etc. leads you down the path to
>> wrong conclusions.
>
> If the recently-dubbed "high quality" REPRESENTs aren't printing out
> intervals then what are they doing? Following the leader?
>
Let's attempt to give a more precise meaning to what is meant by a "high
quality" REPRESENT using the IEEE 754 standard as a guide. There are
several possibilities. First, some definitions from the IEEE 754
standard, and then some possible meanings when we say "high quality".
I. Definitions:
P_min = minimum of number of decimal digits needed, with round to
nearest, for conversion from internal normalized binary representation
to decimal output for the significand, which, when converted back to
binary form gives the same binary significand:
P_min( p ) = 1 + ceiling(p*log_10(2)); p is the number of significant
bits (both actual and implied) of the significand in the binary format.
If a Forth system supports multiple binary formats, define
M = max{P_min(p_i)} where i indexes the binary format
Example: For a Forth system supports both single-precision and
double-precision IEEE binary formats,
M = max{ P_min(24), P_min(53) } = max{ 9, 17 } = 17
II. Possible meanings of "high quality" REPRESENT
There are 3 sensible choices, in my opinion:
II.1) On a given Forth system, REPRESENT will output, with rounding to
nearest a minimum of digits, M, given by maximum of P_min for all
supported binary formats.
For example, if a Forth system supports nothing above binary double
precision (binary64), it should be capable of providing M = 17
significant decimal digits, with round to nearest.
II.2) Follow the IEEE 754 standard and specify that the Forth system has
"an implementation-defined limit on the number of significant digits
that can be converted with correct rounding to and from supported binary
formats. That limit, H, shall be such that H ≥ M + 3 and it should be
that H is unbounded."
Then, the minimum number of significant digits for a system which
supports nothing higher than binary64, it should provide at least H = 20
significant digits in any specified rounding mode.
Note that the IEEE 754 standard goes to pains to specify there is no
upper bound on H, only a lower bound.
II.3) Provide H significant decimal digits to support most *fixed
length* binary formats currently in use, whether they are internally
supported by the Forth system or supported via source code. Some fixed
length binary formats currently in use are:
extended precision (p = 64 bits)
double double precision (p = 106 bits)
quad precision (p = 113 bits)
double extended precision (p = 128 bits)
double quad precision (p = 226 bits)
Then M = 70, and H >= 73 significant digits.
Of the three choices above, II.1 or II.2 is probably what smaller
systems would choose: M = 17 or H = H_min = 20 significant digits. If
they want to provide double double precision, then II.2 would be a
better choice (H = H_min = 36 significant digits).
Systems with less memory constraints should choose II.3.
--
KM
Technical Details
Message-ID:
<11as7ct$2voh4$1@dont-email.me>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mailReferences:
<11aide4$1ibse$1@dont-email.me> <2026Oct12.203631@mips.complang.tuwien.ac.at> <11am4ae$fte4$1@dont-email.me> <nnd$6e3248f1$0599409a@3ae3c368d79558dd> <2026Oct14.102517@mips.complang.tuwien.ac.at> <6ad02ef0$1@news.ausics.net>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: Krishna Myneni <krishna.myneni@ccreweb.org> Newsgroups: comp.lang.forth Subject: Re: FCONSTANT specification Date: Thu, 15 Oct 2026 22:58:19 -0500 Organization: A noiseless patient Spider Lines: 93 Message-ID: <11as7ct$2voh4$1@dont-email.me> References: <11aide4$1ibse$1@dont-email.me> <2026Oct12.203631@mips.complang.tuwien.ac.at> <11am4ae$fte4$1@dont-email.me> <nnd$6e3248f1$0599409a@3ae3c368d79558dd> <2026Oct14.102517@mips.complang.tuwien.ac.at> <6ad02ef0$1@news.ausics.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Fri, 16 Oct 2026 03:58:23 +0000 (UTC) Injection-Info: dont-email.me; logging-data="3138084"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1++tO3yD1FWByZofpc8Q4EI"; posting-host="6424a14b30c7c4c7012a370c8d7efbd9" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:gKz+rMNLM5ViIl1frDZfOcSBbGI= sha256:iiNliEk1Bd+iXBAeXurFU7BC/uwJZ+fFX6VXVj8pLUI= sha1:oAHoIKXl+rTAZGBrHJqFtVMBlyY= sha256:gnVD4mtr9fjmvj6fgJK5MotT32VQnKsojl+ihrjeUSU= In-Reply-To: <6ad02ef0$1@news.ausics.net> Content-Language: en-US