CHAPTER 3

Real and Complex Numbers

3.1 Rational Numbers

A rational number is a number of the form *p/q*, where *p* and *q* are integers. That is, the rational numbers are those numbers that can be represented as the quotient of two integers. The way in which MATLAB treats rational numbers is different from the majority of calculators.

If we ask a calculator to calculate the sum *2/4 + 24/144*, most will return something like *0.6666667*, which is no more than an approximation of the result.

MATLAB can work with rational numbers in exact mode, so the result of arithmetic expressions involving rational numbers is always another rational number. To this end, ...

Start Free Trial

No credit card required