O'Reilly logo

MATLAB Numerical Calculations by César Pérez López

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 3

image

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, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required