Deutsch English Français Italiano |
<v6e4gn$bjep$1@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!news.nobody.at!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Krishna Myneni <krishna.myneni@ccreweb.org> Newsgroups: comp.lang.forth Subject: Re: exercise in double number arithmetic Date: Sun, 7 Jul 2024 08:17:11 -0500 Organization: A noiseless patient Spider Lines: 30 Message-ID: <v6e4gn$bjep$1@dont-email.me> References: <v6c8v0$3usoe$1@dont-email.me> <9c8e8993d3413e65caf355ecc6ceea31@www.novabbs.com> <v6cl84$obt$2@dont-email.me> <5027ddf17f1061435c0ef1df0c5a2061@www.novabbs.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Sun, 07 Jul 2024 15:17:11 +0200 (CEST) Injection-Info: dont-email.me; posting-host="ff7811a63fb4d5a12aa696e08a20351d"; logging-data="380377"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/GGfSxA8eOJx8xnCxyBLfF" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:Cu4xQ/xHI2OIex7zqzqLsWwjIew= In-Reply-To: <5027ddf17f1061435c0ef1df0c5a2061@www.novabbs.com> Content-Language: en-US Bytes: 1931 On 7/7/24 00:48, Ahmed wrote: > On Sat, 6 Jul 2024 23:50:28 (UTC), Krishna Myneni wrote: > >> On 7/6/24 16:59, Ahmed wrote: > ... >> : solution ( -- d) >> 1 s>d 43 22 do i 1 m*/ loop d>f >> 21 dup s>d rot 2 do I 1 m*/ loop d>f >> f/ fround f>d ; >> > ... >> Krishna > > > You have not to use fround. (42!/21!) is an integer and is multiple of > 21!. > in other words 42! is multiple of (21!)^2. > The FROUND is necessary because 42!/21! is too large of an integer to be exactly represented by double-precision fp (IEEE format) and F>D is a truncating operation, not rounding. The whole D>F and floating point operations can be dispensed with if we have D/MOD -- a double length version /MOD. -- Krishna