Sujet : Re: "The Best Programming Language for the End of the World"
De : dxforth (at) *nospam* gmail.com (dxf)
Groupes : comp.lang.forthDate : 09. Apr 2025, 03:21:13
Autres entêtes
Organisation : i2pn2 (i2pn.org)
Message-ID : <cbb106be3daee91e2680165287cd6ca6560245b9@i2pn2.org>
References : 1 2 3 4 5 6 7 8 9 10 11
User-Agent : Mozilla Thunderbird
On 9/04/2025 1:15 am, dxf wrote:
...
It's not SET-PRECISION (presumably the implementer has made that sane)
but rather variability when values are sane e.g.
6 set-precision ok
1e-4 f. 0.000100000 ok
>
6 set-precision ok
1e-4 f. 0.0001 ok
While both of those are numerically correct, they're plainly different i.e.
11 characters vs. 6 characters. As an app writer I'd like some uniformity
here as I might want to output several columns of numbers on a screen. To
do that I need to know how wide to make those columns.
...
Iforth's F. was previously mentioned. In addition to treating PRECISION as
a decimal points specifier (ok it was their decision) F. includes mode
switching based on something called 'fieldwidth' for which I could find no
reference. Is mode switching good or bad? As always - it depends. I've
yet to see a bank statement with the balance displayed in scientific
notation. (But then I'm not Elon Musk so who knows.)
I mention this to demonstrate the variability that exists across forth -
presumably because Forth-94 chose not to think it through leaving folks
to their own devices. REPRESENT ? Well, I could rant about that too :)