Article View: comp.lang.forth
Article #102Re: FCONSTANT specification
From: dxf
Date: Sat, 17 Oct 2026 05:45
Date: Sat, 17 Oct 2026 05:45
68 lines
5013 bytes
5013 bytes
On 16/10/2026 2:58 pm, Krishna Myneni wrote:
> 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.
When Intel developed the 8087 it was with IEEE double-precision in mind.
There's little doubt its the reason they chose an internal representation
of 80 bits to handle at least some of IEEE's arithmetic and conversion
requirements. For me - and perhaps other x87 users - the REPRESENT I can
build using basic x87 instructions is "high quality" enough.
Technical Details
Message-ID:
<6ad30b71$1@news.ausics.net>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!news.ausics.net!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> <11as7ct$2voh4$1@dont-email.me>Show Full Headers
Complete Article Headers
Date: Sat, 17 Oct 2026 16:45:20 +1100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: FCONSTANT specification Newsgroups: comp.lang.forth 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> <11as7ct$2voh4$1@dont-email.me> Content-Language: en-GB From: dxf <dxforth@gmail.com> In-Reply-To: <11as7ct$2voh4$1@dont-email.me> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit NNTP-Posting-Host: news.ausics.net Message-ID: <6ad30b71$1@news.ausics.net> Organization: Ausics - https://newsgroups.ausics.net Lines: 68 X-Complaints: abuse@ausics.net Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!news.ausics.net!not-for-mail