-
Book Overview & Buying
-
Table Of Contents
Scientific Computing with Python 3
By :
At some point, you will have to work with numbers, so we start by considering different forms of numeric types in Python. In mathematics, we distinguish between natural numbers (ℕ), integers (ℤ), rational numbers (ℚ), real numbers (ℝ) and complex numbers (ℂ). These are infinite sets of numbers. Operations differ between these sets and may even not be defined. For example, the usual division of two numbers in ℤ might not result in an integer — it is not defined on ℤ.
In Python, like many other computer languages, we have numeric types:
int, which is at least theoretically the entire ℤfloat, which is a finite subset of ℝ andcomplex, which is a finite subset of ℂFinite sets have a smallest and a largest number and there is a minimum spacing between two numbers; refer to the section on Floating Point Representation for further details.
The...