Re: Average of a [stack]

Liste des GroupesRevenir à cl forth 
Sujet : Re: Average of a [stack]
De : melahi_ahmed (at) *nospam* yahoo.fr (ahmed)
Groupes : comp.lang.forth
Date : 11. Jul 2024, 08:06:40
Autres entêtes
Organisation : novaBBS
Message-ID : <8e8cfdb3c12f69e3a540a2817fdf8a48@www.novabbs.com>
References : 1 2 3 4
User-Agent : Rocksolid Light
On Thu, 11 Jul 2024 3:47:55 +0000, dxf wrote:

On 11/07/2024 8:08 am, Buzz McCool wrote:
On 6/7/2024 1:32 PM, LIT wrote:
: AVG  DEPTH 0 SWAP DUP >R 0 DO SWAP + LOOP R> / . ;
>
I coincidentally was doing averaging for the floating point stack when I
ran across this posting. Other than adding stack comments, how can I
improve this word?
>
Uses less words than BEGIN REPEAT but compiles to more code under VFX
...
>
: FAVG ( rn ... r -- avg )
  fdepth dup >r 1- 0 ?do f+ loop r> s>f f/ ;
Hi,
without >r and r>
: favg fdepth dup 1- 0 ?do f+ loop s>f f/ ;
Ahmed

Date Sujet#  Auteur
10 Jul 24 * Re: Average of a [stack]28Buzz McCool
11 Jul 24 +* Re: Average of a [stack]10dxf
11 Jul 24 i`* Re: Average of a [stack]9Buzz McCool
12 Jul 24 i `* Re: Average of a [stack]8dxf
12 Jul 24 i  `* Re: Average of a [stack]7Buzz McCool
15 Jul 24 i   `* Re: Average of a [stack]6Buzz McCool
18 Jul 24 i    `* Re: Average of a [stack]5minforth
18 Jul 24 i     `* Re: Average of a [stack]4Buzz McCool
18 Jul 24 i      +- Re: Average of a [stack]1minforth
19 Jul 24 i      `* Re: Average of a [stack]2dxf
19 Jul 24 i       `- Re: Average of a [stack]1Buzz McCool
11 Jul 24 +* Re: Average of a [stack]16dxf
11 Jul 24 i`* Re: Average of a [stack]15ahmed
11 Jul 24 i `* Re: Average of a [stack]14ahmed
11 Jul 24 i  `* Re: Average of a [stack]13minforth
11 Jul 24 i   `* Re: Average of a [stack]12ahmed
11 Jul 24 i    +- Re: Average of a [stack]1ahmed
11 Jul 24 i    `* Re: Average of a [stack]10minforth
11 Jul 24 i     `* Re: Average of a [stack]9ahmed
11 Jul 24 i      +- Re: Average of a [stack]1minforth
14 May 25 i      `* Re: Average of a [stack]7anthk
14 May 25 i       `* Re: Average of a [stack]6ahmed
14 May 25 i        +- Re: Average of a [stack]1ahmed
15 May 25 i        `* Re: Average of a [stack]4dxf
15 May 25 i         +* Re: Average of a [stack]2Hans Bezemer
15 May 25 i         i`- Re: Average of a [stack]1dxf
15 May 25 i         `- Re: Average of a [stack]1Hans Bezemer
12 Jul 24 `- Re: Average of a [stack]1Anton Ertl

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal