Php – Numeric Variable Types Like Integer, Float, Double – POFTUT

Php – Numeric Variable Types Like Integer, Float, Double

[rps-include post=6522]

Php provides different numeric variable types. In this tutorial we will look them in detail. The numeric types available in Php are listed below.

  • Integer
  • Float
  • Double

Numeric values are used mainly used for mathematical calculations. If we will use numbers just like id or school number better way is using string but if we will made calculations, dividing etc. we need numeric variable types.


Integer type variables holds non floating numeric and calculable values. We can use integer variables to hold count, round type situations. Here we will make an example about integer. We will use $count integer variable to hold count of students.

$count = 23;

Each integer variable holds 4 byte in the memory. The maximum and minimum values changed according to system architecture like 32 or 64 bit.

32 bit

Minimum: -2147483648

Maximum: 2147483647

64 bit

Minimum: -9223372036854775808

Maximum: 9223372036854775807

Floating Point

Integers have vast use cases but it is not enough to express all numeric cases. Float type of variables are used to store floating point numbers. In this example we will store price of a laptop with a floating point number. We will use point . to specify decimal and floating point part like below.


Another floating point definition syntax is using e for 64 bit IEEE format like below.


[rps-include post=6522]

LEARN MORE  Dictionary In Python Tutorial

Leave a Comment