Simple Mathematical Operators

suggest change

Introduction

Python does common mathematical operators on its own, including integer and float division, multiplication, exponentiation, addition, and subtraction. The math module (included in all standard Python versions) offers expanded functionality like trigonometric functions, root operations, logarithms, and many more.

Remarks

Numerical types and their abstract base classes

The numbers module contains the abstract base classes for the numeric types. A check mark means issubclass is true.

Type Number Integral Rational Real Complex
bool ✓ ✓ ✓ ✓ ✓
int ✓ ✓ ✓ ✓ ✓
fractions.Fraction ✓ ― ✓ ✓ ✓
float ✓ ― ― ✓ ✓
complex ✓ ― ― ― ✓
decimal.Decimal ✓ ― ― ― ―

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents