🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.forth
Article #68

Re: FCONSTANT specification

#68
From: marcel hendrix
Date: Mon, 12 Oct 2026 14:56
23 lines
2049 bytes
On 10/12/2026 4:14 PM, Krishna Myneni wrote:
[..]> 2.0e0 FLOG FCONSTANT _FLOG2
> [UNDEFINED] FCEIL [IF]
> : FCEIL ( F: r1 -- r2 ) FNEGATE FLOOR FNEGATE ;
> [THEN]
> 
> : P_min ( u1 -- u2) S>F _FLOG2 F* FCEIL F>D DROP 1+ ;

FORTH> xd=pi (xdfe.) 2dup CR TYPE  DROP #25 4 + CR TYPE
3.14159265358979323846264338327950288422e0
3.141592653589793238462643383 ok

So here it is easy to see it is correct.
What if PI had been 3.1415926535897932384626433835121212121212 ?

FORTH> s" 3.1415926535897932384626433835121212121212e" cr 2dup TYPE
 >XD (xdfe.) DROP #25 4 + CR TYPE
3.1415926535897932384626433835121212121212e
3.141592653589793238462643383 ok

Maybe don't ever output more than 25 digits?

-marcel
Technical Details
Message-ID: <11aisee$e9sc$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-mail
References: <11aide4$1ibse$1@dont-email.me> <11aijvt$3iobp$1@dont-email.me> <11ainru$3kbfc$1@dont-email.me> <11aipvm$3kbfc$2@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: marcel hendrix <mhx@iae.nl>
Newsgroups: comp.lang.forth
Subject: Re: FCONSTANT specification
Date: Mon, 12 Oct 2026 16:56:13 +0200
Organization: A noiseless patient Spider
Lines: 23
Message-ID: <11aisee$e9sc$1@dont-email.me>
References: <11aide4$1ibse$1@dont-email.me> <11aijvt$3iobp$1@dont-email.me>
 <11ainru$3kbfc$1@dont-email.me> <11aipvm$3kbfc$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 12 Oct 2026 14:56:15 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="468876"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19o7mv+XkWZJwmdBuM6ivqU5DYUrL+kdpc="; posting-host="2cbd0f5d5bdd21d0759d7ae701ea74d9"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:ePxBYJKxgJDc8Yxt/X6K7EfBI3Q= sha256:3KkrIoG4Gkmzl+j4Bqig2Mw+fAgp1pnX2Pj++RaHSAQ=
	sha1:YW2SiLELqGu8cxMLPNOcJeiz5cE= sha256:LyWUzNJfFOTsyAWoTwnNMo4kgWX5AcQZ003lErL0ZMQ=
Content-Language: en-US
In-Reply-To: <11aipvm$3kbfc$2@dont-email.me>