🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.forth
Article #40

Re: F.N floating point format word

#40
From: dxf
Date: Fri, 09 Oct 2026 03:29
32 lines
2213 bytes
On 8/10/2026 9:13 pm, peter wrote:
> On Thu, 8 Oct 2026 13:34:33 +1100
> dxf <dxforth@gmail.com> wrote:
> 
>> On 8/10/2026 7:35 am, peter wrote:
>>> ... 
>>> 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.
>>
>> Are you sure it's necessary?  Your tests appear to work with it set at 5.
>>
> 
> You might be right!
> My first concern was for number like
> 9.9999999995e that will round up all the way and get a exp+1
> But it looks like the code handles that also.

There a risk when extracting the exponent on its own.  As Anton pointed out
in another thread REPRESENT at least keeps mantissa and exponent in sync.

> The problem was 99.995e 2 f.n that became 100.0
> ...

Every REPRESENT I know gives that:

  99.995e pad 4 REPRESENT drop 2drop pad 4 dump
  195FE0 | 31 30 30 30                                      |1000| ok
Technical Details
Message-ID: <6ac85f7b$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-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> <6ac7013a$1@news.ausics.net> <20261008121302.00007412@tin.it>

Show Full Headers
Complete Article Headers
Date: Fri, 9 Oct 2026 14:29:00 +1100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: F.N floating point format word
Newsgroups: comp.lang.forth
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> <6ac7013a$1@news.ausics.net>
 <20261008121302.00007412@tin.it>
Content-Language: en-GB
From: dxf <dxforth@gmail.com>
In-Reply-To: <20261008121302.00007412@tin.it>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: news.ausics.net
Message-ID: <6ac85f7b$1@news.ausics.net>
Organization: Ausics - https://newsgroups.ausics.net
Lines: 32
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