Article View: comp.lang.forth
Article #74Re: FCONSTANT specification
From: Anton Ertl
Date: Mon, 12 Oct 2026 18:36
Date: Mon, 12 Oct 2026 18:36
31 lines
2509 bytes
2509 bytes
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.
>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.
>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.
- anton
--
M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
New standard: https://forth-standard.org/
EuroForth 2026 CFP: http://www.euroforth.org/ef26/cfp.html
Technical Details
Message-ID:
<2026Oct12.203631@mips.complang.tuwien.ac.at>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-mailReferences:
<11aide4$1ibse$1@dont-email.me>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: anton@mips.complang.tuwien.ac.at (Anton Ertl) Newsgroups: comp.lang.forth Subject: Re: FCONSTANT specification Date: Mon, 12 Oct 2026 18:36:31 GMT Organization: Institut fuer Computersprachen, Technische Universitaet Wien Lines: 31 Message-ID: <2026Oct12.203631@mips.complang.tuwien.ac.at> References: <11aide4$1ibse$1@dont-email.me> Injection-Date: Mon, 12 Oct 2026 18:48:37 +0000 (UTC) Injection-Info: dont-email.me; logging-data="3993846"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Ybt0L5UZhTGhdXRPn351J"; posting-host="34af6eed5d169cfbd9c0423f6ed6f4a9" Cancel-Lock: sha1:TpJe3AUVvd/u2kJqiiT3JlU0Jig= sha256:8/ugn8VGqkHtMhKpFWqZVLo3Jfz8P1zDAk8+Y27TFDE= sha1:pg0N+aPPpQyYf7+A0wd+88rWvTg= sha256:VlhuA06fvWMCD9dHvtFJNsra+Uka8Tpf2xvQztpi3w8= X-newsreader: xrn 10.11