gforth
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gforth] Floating point numbers and 'precision'


From: Anton Ertl
Subject: Re: [gforth] Floating point numbers and 'precision'
Date: Thu, 26 Sep 2019 08:09:00 +0200
User-agent: NeoMutt/20170113 (1.7.2)

On Wed, Sep 25, 2019 at 09:24:31AM -0400, J. David Boyd wrote:
> 
> What was the rationale for "precision" being used in fe., fs., and fp., but
> _not_ in f.s?

I don't remember it exactly.  Factors that probably played a role:

0) Probably originally there was the idea to use the ability of f.rdp
to show FP numbers in fixed-point or exponential notation, but that
idea was later dropped in favour of output that is interpreted as FP
number when copied and pasted into the text interpreter.

1) With the default precision, the output of fs. is at least 18 chars long.

2) The output of fs. may differ in length.  f.rdp always produces the
same length, which makes it easier to compare the outputs of
successive f.s output lines.

It's not cast in stone.  Instead of "16 5 11 f.rdp", f.s could also
use "precision 7 max dup 0 f.rdp" or somesuch.

- anton



reply via email to

[Prev in Thread] Current Thread [Next in Thread]