🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.forth
Article #77

Re: FCONSTANT specification

#77
From: marcel hendrix
Date: Tue, 13 Oct 2026 20:29
41 lines
3150 bytes
On 10/12/2026 8:36 PM, Anton Ertl wrote:
> marcel hendrix <mhx@iae.nl> writes:
>> In view of the current thread of floating-point input and output, how
>> should we specify FCONSTANTs ? My concern is when the system potentially
>> uses single, double, or extended-double (or worse).
> 
> Standard Forth only has one FP type on the FP stack, and FCONSTANT
> stores that and pushes that, just like F! and F@ do.
> 

Procrustes Forth? On such a system SF@/! and DF@/! must convert an 
internal to an external format, and the conversion must be precise.
Switching between single and double precision is a well-known trick to 
improve convergence of certain algorithms. This conversion *could* be a 
serious headache.

>> Is the algorithm that guarantees that a printed number can be converted
>> 'losslessly' back to its internal presentation able to do that
>> regardless of the number of bits in the internal representation?
> 
> Sure.

My question is: if we have a text representation of a number with say 40 
(or whatever) digits, will that unchanged string work to give the
best approximation on single, double, ... binary internal formats?
Is your answer to that: 'Sure' ?
>> We probably don't want that FP library code developed for a double
>> implementation specifies table constants etc. that are depending on the
>> precision of its internal implementation.
> 
> You will have to work with some limit, but I expect that you can make
> numbers with, say 36 digits, and ideally you can derive the numbers
> for various formats up to binary128 from that.  But if the mathematics
> behind these numbers is not just to use an approximation to something,
> but to have a bias that corrects for some error elsewhere, maybe that
> is not enough.
...you can derive the numbers...

The question still is: How?

-marcel
Technical Details
Message-ID: <11am4ae$fte4$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-mail
References: <11aide4$1ibse$1@dont-email.me> <2026Oct12.203631@mips.complang.tuwien.ac.at>

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: marcel hendrix <mhx@iae.nl>
Newsgroups: comp.lang.forth
Subject: Re: FCONSTANT specification
Date: Tue, 13 Oct 2026 22:29:01 +0200
Organization: A noiseless patient Spider
Lines: 41
Message-ID: <11am4ae$fte4$1@dont-email.me>
References: <11aide4$1ibse$1@dont-email.me>
 <2026Oct12.203631@mips.complang.tuwien.ac.at>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 13 Oct 2026 20:29:02 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="521668"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1+EwfgXbrDTvHRsrSrCLZz5+YuHT94sRZ0="; posting-host="3470da0ac0b7fbbe34914582d9c0d346"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:c7P+YzlrH75UevksOdZEmEldCuk= sha256:Ll4K3B/Nsmj7e0XjHKxcsgt4mjlwS+W3A1s+QAd9zQU=
	sha1:a87nsMwLYvqySfMfWMjwvnBTwc8= sha256:mEZXl5A2FWA9A+0unwtb8SbKpCA7XmpBnamuaz0tB88=
Content-Language: en-US
In-Reply-To: <2026Oct12.203631@mips.complang.tuwien.ac.at>