# Python Numbers

Python Numbers. To perform mathematical operations it is necessary that support for different types of numbers is available in a programming language.

Python contains a type of class of all types, which defines the structure and function of numbers. This type shows how the number will be store and what operations can be done with it.

By implementing all the number types in classes as Python, you can check whether a number is of a particular type or not. For this python provides functions like type() and isinstance().

Python supports four numerical types.

- Integer
- Long
- Floating Point
- Complex

The order of operation in the integer and floating point numbers remains almost the same. First of all, multiplication and division are performed, then addition and subtraction are performed.

## integer

In Python, integer numbers are related to int class. Integer numbers are whole numbers. It does not have a decimal. An integer can be negative, positive or zero.

When an integer is negative, then it is called signed integer.

### Example

1 2 3 4 5 6 7 8 9 |
25 -0x260 65 -25 0 100 -98 48 0x69 |

## long

An unlimited size integer called long integer in python. It is also written like an integer and after this, an uppercase or lowercase ‘L’ is written.

### Example

1 2 3 4 5 6 7 |
2598659L 69584723L 0xDEFABCECBECBFBAEL 535685626343L -5896526L -2587410250250L -0x5206580L |

## float

In Python, the floating point numbers are related to the float class. Floating point numbers are such numbers in which the decimal is followe by some numbers.

Floating point numbers can be negative or positive.

### Example

1 2 3 4 5 6 7 8 |
45 -36 0 3.23 5.30 32.3+e18 8 -32.54e100 |

Floating point numbers are also use as a scientific number along with e to show the power of 10.

In relation to the floating point numbers, you should always keep in mind that the result of the operations on floating point numbers is also a floating point number.

## complex

The complex numbers in the Python are related to the complex class. There are real and imaginary two parts of complex numbers.

A complex number is represented in the form of a + bi. There are a and b real numbers (floats) and i is an imaginary number. The imaginary number is represented by j.

### Example

1 2 3 4 5 6 |
2e+25J -.6545+0J 4.53e-7j 3.14j .876j 9.322e-36j |