Liste des Groupes | Revenir à cl forth |
On 11/07/2024 8:08 am, Buzz McCool wrote:Hi,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/ ;
Les messages affichés proviennent d'usenet.