Stats

661 Contributors: 26
2017-03-21
Licensed under: CC-BY-SA

Not affiliated with Stack Overflow
Rip Tutorial: info@zzzprojects.com

Download eBook

Simple Mathematical Operators

Download python eBook

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 metaclasses

The numbers module contains the abstract metaclasses for the numerical types:

subclassesnumbers.Numbernumbers.Integralnumbers.Rationalnumbers.Realnumbers.Complex
bool
int
fractions.Fraction
float
complex
decimal.Decimal

Related Examples