🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.forth
Article #146

Re: FCONSTANT specification

#146
From: marcel hendrix
Date: Tue, 20 Oct 2026 06:52
24 lines
2698 bytes
On 10/20/2026 4:55 AM, Paul Rubin wrote:
> Nice, what is the memory representation?

They look like an array of 4 extended doubles, and in fact, they are.
The trick is that *sum* of these four normal 64 bit floats is precisely
equal to a single float with a 4*64 = 256 bit mantissa. This is done by 
manipulating the exponents. See "Software for Doubled-Precision 
Floating-Point Computations", Seppo Linnainmaa, ACM Transactions on 
Mathematical Software, Vol 7, No 3, September 1981, Pages 272-283.

>> The xd-fp library, with a full set of math functions, is only 800
>> lines of Forth including comments.

> That's pretty good, I thought carefully done math functions could be
> messy.

The float library is based on David H. Bailey's paper and is very 
concise. I used only the paper, but there are special issues with 
specifying constants and literals that I originally ignored, see a few 
other threads here. Looking at the (bulky) C, source helped a little:
https://github.com/greggroth/im_learning_cpp/blob/master/comp_programing_exam_solution/qd-2.3.12/src 


-marcel
Technical Details
Message-ID: <11b7337$269bk$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> <2026Oct12.203631@mips.complang.tuwien.ac.at> <11am4ae$fte4$1@dont-email.me> <nnd$6e3248f1$0599409a@3ae3c368d79558dd> <2026Oct14.102517@mips.complang.tuwien.ac.at> <6ad02ef0$1@news.ausics.net> <11as7ct$2voh4$1@dont-email.me> <11atg9c$1t6lk$1@dont-email.me> <87zewaslrh.fsf@nightsong.com> <11b3i7a$22vg2$1@dont-email.me> <87qzhlrsgo.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: marcel hendrix <mhx@iae.nl>
Newsgroups: comp.lang.forth
Subject: Re: FCONSTANT specification
Date: Tue, 20 Oct 2026 08:52:21 +0200
Organization: A noiseless patient Spider
Lines: 24
Message-ID: <11b7337$269bk$1@dont-email.me>
References: <11aide4$1ibse$1@dont-email.me>
 <2026Oct12.203631@mips.complang.tuwien.ac.at> <11am4ae$fte4$1@dont-email.me>
 <nnd$6e3248f1$0599409a@3ae3c368d79558dd>
 <2026Oct14.102517@mips.complang.tuwien.ac.at> <6ad02ef0$1@news.ausics.net>
 <11as7ct$2voh4$1@dont-email.me> <11atg9c$1t6lk$1@dont-email.me>
 <87zewaslrh.fsf@nightsong.com> <11b3i7a$22vg2$1@dont-email.me>
 <87qzhlrsgo.fsf@nightsong.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 20 Oct 2026 06:52:23 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="2303348"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1+mPRULACYJS07O4VPFFWd8wo7zwOnC2LI="; posting-host="9af0d298bf90b86c84ab0cdc0d07855f"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:MPdbMUlqGnPp1xCAv2uIslxHi34= sha256:UotM6lIB3shsh1ElKti/8lQ5q2/HtFywfeJUN/zzwmA=
	sha1:oWPZUR1XZjvRrbtQ5y9832NOJNA= sha256:sCqTRhjjWB/Z5ptQiVA7/uuRGaBj3SnOUGcqzWYaDS8=
In-Reply-To: <87qzhlrsgo.fsf@nightsong.com>
Content-Language: en-US