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 >
Wrap
OS/2 REXX Batch file
|
1996-11-19
|
1KB
|
23 lines
/******************************************************************************/
/* usecomp Object REXX Samples */
/* */
/* A simple demonstration of the complex number class */
/* */
/* This program demonstrates use of the ::requires directive using the */
/* complex number class included in the samples. */
/******************************************************************************/
Say 'A simple example of complex number arithmetic:'
comp1 = .complex[8,4] /* create two complex numbers */
comp2 = .complex[4,1]
/* Note that SAY uses the STRING method of the COMPLEX class for display */
say '('comp1') + ('comp2') is' comp1+comp2
say '('comp1') - ('comp2') is' comp1-comp2
say '('comp1') * ('comp2') is' comp1*comp2
say '('comp1') / ('comp2') is' comp1/comp2
say '('comp1') % ('comp2') is' comp1%comp2
say '('comp1') // ('comp2') is' comp1//comp2
::REQUIRES complex