Article View: comp.lang.forth
Article #12Re: You cannot know how many cells a floating-point number takes?
From: Hans Bezemer
Date: Wed, 07 Oct 2026 08:11
Date: Wed, 07 Oct 2026 08:11
42 lines
2905 bytes
2905 bytes
On 06-10-2026 22:13, Paul Rubin wrote: > Hans Bezemer <the.beez.speaks@gmail.com> writes: >> 1 floats 1 cells /mod . . 1 0 ok >> So it told me -- without ANY doubt whatsoever, that the size of a >> FLOAT is equal to the size of a CELL. > > That's on your specific installation, which might be 64-bit gforth. You > could also try it with 32-bit gforth, which might still use 64-bit > floats. > In Forth-2012 I think the FP stack is mandated. Note this is what we're talking about: I bumped into this Gforth manual page: "5.6.2 Floating point stack Whilst every sane Forth has a separate floating-point stack, it is not strictly required; an ANS Forth system could theoretically keep floating-point numbers on the data stack." And here it comes: "As an additional difficulty, you don't know how many cells a floating-point number takes." Given Forth-2012, true, the FP stack is mandated. Which makes this paragraph moot to begin with: "12.3.3 Floating-point stack -- The floating-point stack shall be separate from the data and return stacks." But okay -- not everybody takes updating their manual that serious. And I never said that there should be fixed values attached to CELLS/FLOAT. I just claimed that the statement "As an additional difficulty, you don't know how many cells a floating-point number takes" is simply untrue. Whether the size of the FVARIABLE or the size of an FP item on a shared stack -- it can be known. You don't even have to manually maintain it, you can have the compiler figure it out at runtime. Hans Bezemer
Technical Details
Message-ID:
<11a4us0$2lq6j$1@dont-email.me>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:
<11a28dj$1nh2c$1@dont-email.me> <87se2i37vn.fsf@nightsong.com>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: Hans Bezemer <the.beez.speaks@gmail.com> Newsgroups: comp.lang.forth Subject: Re: You cannot know how many cells a floating-point number takes? Date: Wed, 7 Oct 2026 10:11:44 +0200 Organization: A noiseless patient Spider Lines: 42 Message-ID: <11a4us0$2lq6j$1@dont-email.me> References: <11a28dj$1nh2c$1@dont-email.me> <87se2i37vn.fsf@nightsong.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 07 Oct 2026 08:11:45 +0000 (UTC) Injection-Info: dont-email.me; logging-data="2812115"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Zdfo7XrHgh15CFTs+yJbK"; posting-host="12c5caa003615669d1567fa5f6d9aa79" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:0QPJLGDNnDIElMDq0ZkEOcY4Bq0= sha256:Q8PoKWymwluKgOXuBKs4i4mRLGbqga/EBtyVCwf8WZw= sha1:3bcnCtc6PaB1aY5ZJ6WS6m4ubK0= sha256:K1O91tjr0oT3qD99ixZsMfXxXMMlvZ4f8URaaTE20a0= Content-Language: en-US In-Reply-To: <87se2i37vn.fsf@nightsong.com>