home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / forth / compiler / fpc / source / temp.seq < prev    next >
Text File  |  1990-04-08  |  351b  |  15 lines

  1.  
  2. \ Compute area of a circle to three decimal places.
  3. : CIRCLE_AREA ( r -- )
  4.         DUP * 355 * 113 /MOD
  5.         ." Area = " 5 .R \ ( 8 EMIT ) 1 BACKSPACES
  6.         ASCII . EMIT
  7.         5 0  DO
  8.              10 * 113 /MOD 1 .R \ ( 8 EMIT ) 1 BACKSPACES
  9.              LOOP DROP ;
  10.  
  11. : TEST_CIRC ( -- )
  12.        11 1 DO CR I CIRCLE_AREA LOOP ;
  13.  
  14.  
  15.