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.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Arithmetic

  • Hugo D. Junghenn

摘要

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.