Arithmetic
摘要
In this chapter we construct the module Arithmetic.py, which evaluates arithmetic expressions with Gaussian rational numbers, Gaussian rational numberthat is, complex numbers \(z=a+bi\) , where a and b are rational numbers, called the real and imaginary parts of z, respectively. (Arithmetic expressions were defined in Chap. 2.) Complex numbers are stored in the module as lists. For example, the complex number \(2/3 + (4/5)i\) is stored as [2/3,4/5]. All quantities are in string form.