🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.forth
Article #24

Re: F.N floating point format word

#24
From: Krishna Myneni
Date: Wed, 07 Oct 2026 21:59
34 lines
2780 bytes
On 10/7/26 3:35 PM, peter wrote:
> On Wed, 7 Oct 2026 02:49:57 -0500
> Krishna Myneni <krishna.myneni@ccreweb.org> wrote:
> 
...
>>
>> In the definition of (F.N) you use an argument of u = 32 significant
>> digits to REPRESENT. I did not understand why you chose this particular
>> number to obtain the decimal exponent (exp). I changed this to 17 and
>> all of the tests in fdotn-test.4th still pass.
>>
>> : (f.n) ...
>>    fdup fabs fswap fpad ( 32) 17 represent  \ find exp and sign
>>
>> Since binary -> decimal conversion with 17 significant digits is
>> guaranteed to cycle in a round trip for binary64, I think 17 will
>> suffice here for obtaining the correct decimal exponent.
> 
> There were no real reason. The result at fpad is used only for
> INF and NAN. I also wanted a number larger then 17, 32 looked like
> a good round number. The importance of the first call to represent
> is to get a correct exp to use in the following calculations.
> The second time represent is called it will be with u=exp+n to get
> the correct rounding.
> 

There may be an efficiency gain to going with the minimum number of 
significant digits to get the exponent. I haven't benchmarked it, but 
big number arithmetic comes into play when dealing with such a large 
number of significant digits.

--
KM
Technical Details
Message-ID: <11a6fc4$39ehc$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: <119oin2$26n99$1@dont-email.me> <11a01mr$sqrm$1@dont-email.me> <20261005150222.00006cf5@tin.it> <11a16nc$1camn$1@dont-email.me> <20261006080347.00002cdf@tin.it> <11a4tj5$2ku7v$1@dont-email.me> <20261007223526.000065ab@tin.it>

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: F.N floating point format word
Date: Wed, 7 Oct 2026 16:59:31 -0500
Organization: A noiseless patient Spider
Lines: 34
Message-ID: <11a6fc4$39ehc$1@dont-email.me>
References: <119oin2$26n99$1@dont-email.me> <11a01mr$sqrm$1@dont-email.me>
 <20261005150222.00006cf5@tin.it> <11a16nc$1camn$1@dont-email.me>
 <20261006080347.00002cdf@tin.it> <11a4tj5$2ku7v$1@dont-email.me>
 <20261007223526.000065ab@tin.it>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 07 Oct 2026 21:59:33 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="3455532"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1/Nr7MdU9vtX7chuDsOOHT+"; posting-host="d05ed1c28a75393cf2b11653aaa7e6f7"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:sYN1bLewe28ICIuUhDQg4JI01NU= sha256:TlL3a5vU7gB9aqoQXRYBvfZR+QozpBayaOoZ8uWaha0=
	sha1:tdCM9UK9enGTd4pUOIWtGsQPm+4= sha256:CF5gOCC1jR7qDI5SKF6pqZ00Rw38MGhBgdP4QYHsoOM=
Content-Language: en-US
In-Reply-To: <20261007223526.000065ab@tin.it>