🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.forth
Article #193

Re: FCONSTANT specification

#193
From: Anton Ertl
Date: Thu, 29 Oct 2026 09:18
41 lines
2776 bytes
dxf <dxforth@gmail.com> writes:
>Whatever GCC is printing - it's not what
>the user entered.

GCC prints the things you ask it to, usually not FP numbers, but,
e.g., compiler warnings and error messages.

But as for printing what the user entered, here's what Gforth does:

.1000000000000000055511151231257827021181583404541015625e e.exact

outputs

.1000000000000000055511151231257827021181583404541015625e

Admittedly, there are a lot of numbers around that cannot be
represented exactly as binary64 number, and for those the cycle
decimal->binary64->decimal (using >FLOAT and E.EXACT based on a recent
glibc release) does not print what is input, but the rounding happens
at decimal->binary64 stage, not on the output.

Does it look any better for, e.g., E. or 17 e.p?  Consider

.90000000000000007e

E. prints

.9e

17 E.P prints

.90000000000000002e

Note that none of these numbers has more than 17 decimal digits.

- 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: <2026Oct29.101853@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-mail
References: <11aide4$1ibse$1@dont-email.me> <2026Oct15.075508@mips.complang.tuwien.ac.at> <6ad17c5a$1@news.ausics.net> <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>

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: Thu, 29 Oct 2026 09:18:53 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 41
Message-ID: <2026Oct29.101853@mips.complang.tuwien.ac.at>
References: <11aide4$1ibse$1@dont-email.me> <2026Oct15.075508@mips.complang.tuwien.ac.at> <6ad17c5a$1@news.ausics.net> <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>
Injection-Date: Thu, 29 Oct 2026 09:39:36 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="3353789"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX193deVF7toUethPv+37D8kX"; posting-host="5ad9f9b19fb54b6c0af64c25657e7760"
Cancel-Lock: sha1:/OkkizkYALF5w6MAbVPVyE4F8fo= sha256:tD5M09VBd5LActdzQIBmN6gmpjXkGfetPgwmK75Jr2M=
	sha1:rpEd+Bxd2y+iqu9kxxD9j299krw= sha256:Zq1pUKgULX8wDUOMHKEZBGss4eopucA2GFEJ1gV0Csk=
X-newsreader: xrn 10.11