home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / viscobv6.zip / vac22os2 / ibmcobol / samples / toolkit / rexx / usecomp.cmd < prev    next >
OS/2 REXX Batch file  |  1996-11-19  |  1KB  |  23 lines

  1. /******************************************************************************/
  2. /*  usecomp                  Object REXX Samples                              */
  3. /*                                                                            */
  4. /*  A simple demonstration of the complex number class                        */
  5. /*                                                                            */
  6. /*  This program demonstrates use of the ::requires directive using the       */
  7. /*  complex number class included in the samples.                             */
  8. /******************************************************************************/
  9.  
  10. Say 'A simple example of complex number arithmetic:'
  11. comp1 = .complex[8,4]                       /* create two complex numbers     */
  12. comp2 = .complex[4,1]
  13.  
  14. /* Note that SAY uses the STRING method of the COMPLEX class for display      */
  15. say '('comp1') + ('comp2') is' comp1+comp2
  16. say '('comp1') - ('comp2') is' comp1-comp2
  17. say '('comp1') * ('comp2') is' comp1*comp2
  18. say '('comp1') / ('comp2') is' comp1/comp2
  19. say '('comp1') % ('comp2') is' comp1%comp2
  20. say '('comp1') // ('comp2') is' comp1//comp2
  21.  
  22. ::REQUIRES complex
  23.