Article View: comp.lang.forth
Article #200Re: FCONSTANT specification
From: Anton Ertl
Date: Fri, 30 Oct 2026 06:47
Date: Fri, 30 Oct 2026 06:47
28 lines
2878 bytes
2878 bytes
dxf <dxforth@gmail.com> writes:
>It's not clear to me that IEEE even talks in terms of 'representable' numbers
>which leads to the junk that GCC et al print out:
>
> 5.1 Overview
>
> "Each of the computational operations that return a numeric result specified by
> this standard shall be performed as if it first produced an intermediate result
> correct to infinite precision and with unbounded range, and then rounded that
> intermediate result, if necessary, to fit in the destination’s format"
This already says it: "if necessary". When the result is
representable in the destination's format, rounding is not necessary.
When the destination format is a string buffer with enough digits,
rounding is not necessary, and the exact value can be shown.
OTOH, almost all (as in "all but finitely many") numbers do not fit in
binary64, so for almost all numbers that you might convert from a
decimal string to a binary64 FP number, rounding happens on the
conversion. The exceptions are notable, though, e.g., all integers
<=2^53.
- 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:
<2026Oct30.074708@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> <2026Oct16.071212@mips.complang.tuwien.ac.at> <6ad2df65$1@news.ausics.net> <11auu2d$3t6hf$2@dont-email.me> <11b2cv4$142ig$1@dont-email.me> <11b2nct$17v9i$1@dont-email.me> <11bl2ar$3lj23$1@dont-email.me> <11bobpu$trdt$1@dont-email.me> <11bogem$vnlk$1@dont-email.me> <6ae16eae$1@news.ausics.net> <11bsn80$2cg90$1@dont-email.me> <6ae2b06f$1@news.ausics.net> <6ae30b4f$1@news.ausics.net> <2026Oct29.101853@mips.complang.tuwien.ac.at> <6ae3e0af$1@news.ausics.net>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: Fri, 30 Oct 2026 06:47:08 GMT Organization: Institut fuer Computersprachen, Technische Universitaet Wien Lines: 28 Message-ID: <2026Oct30.074708@mips.complang.tuwien.ac.at> References: <11aide4$1ibse$1@dont-email.me> <2026Oct16.071212@mips.complang.tuwien.ac.at> <6ad2df65$1@news.ausics.net> <11auu2d$3t6hf$2@dont-email.me> <11b2cv4$142ig$1@dont-email.me> <11b2nct$17v9i$1@dont-email.me> <11bl2ar$3lj23$1@dont-email.me> <11bobpu$trdt$1@dont-email.me> <11bogem$vnlk$1@dont-email.me> <6ae16eae$1@news.ausics.net> <11bsn80$2cg90$1@dont-email.me> <6ae2b06f$1@news.ausics.net> <6ae30b4f$1@news.ausics.net> <2026Oct29.101853@mips.complang.tuwien.ac.at> <6ae3e0af$1@news.ausics.net> Injection-Date: Fri, 30 Oct 2026 07:00:51 +0000 (UTC) Injection-Info: dont-email.me; logging-data="36380"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18QUzAmtd4sc3OFe9eFVa1v"; posting-host="639559d727fb030ac617c0bb2c358fb0" Cancel-Lock: sha1:hFXAdBKlXvp8472PYKtGzcSS4iU= sha256:v4X1N0ZOV2HlI1ACpREkiN78Yearu4olHJttATcTFcs= sha1:mPLrAsjPkiRH3/KCXBDrNWM4Bq4= sha256:fGfkvK0OgMAvPKaorlDY4AWEOrKxxMJkJWivAkVDwGE= X-newsreader: xrn 10.11