next up previous contents
Next: Solution Up: Procedures and Modules Previous: Solution

 

Complex Arithmetic - Modules

A complex number with solely integer components can be represented as a two element INTEGER array. Write a MODULE called Integer_Complex_Arithmetic which contains 4 FUNCTION s each accepting two integer complex number `operands' and delivering the result of addition, subtraction, multiplicition and division. Where appropriate Fortran 90 integer division rules should be followed. The following rules for complex arithmetic may be useful,

displaymath2930

and,

displaymath2931

and,

displaymath2932

and,

displaymath2933

Also write a procedure to accept one integer complex number and one non-negative integral exponent which delivers the result of **.

Note, for tex2html_wrap_inline2940 ,

displaymath2934




next up previous contents
Next: Solution Up: Procedures and Modules Previous: Solution

Adam Marshall ©University of Liverpool, 1996
Fri Dec 6 14:10:26 GMT 1996