Jensen's Device: Difference between revisions

m
S>F is now part of the ANS Forth standard
(→‎{{header|Groovy}}: new solution)
m (S>F is now part of the ANS Forth standard)
Line 344:
 
=={{header|Forth}}==
<lang forth>: sum 0 s>f s>d1+ swap ?do i over execute d>f+ loop drop ;
: sum 0 s>f 1+ swap ?do i over execute f+ loop drop ;
:noname s>f 1 s>f fswap f/ ; 1 100 sum f.</lang>
Output: 5.18737751763962
 
=={{header|Groovy}}==
{{trans|JavaScript}}
374

edits