Php – Numeric Variable Types Like Integer, Float, Double

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/numeric-variable-types-like-integer-float-double/
PINTEREST
PINTEREST
INSTAGRAM

PHP Tutorial Topics

  1. Introduction To PHP
  2. Installing PHP To Linux
  3. Installing PHP To Windows
  4. PHP Hello World Project with Eclipse
  5. PHP Syntax
  6. PHP Variables and Types
  7. PHP String Types
  8. PHP Numeric Type (Integer, Float, Double)
  9. PHP Boolean Type
  10. PHP Arrays
  11. PHP Operators
  12. PHP Ternary Operators
  13. PHP Constants
  14. PHP If..Elseif..Else Conditional Statements
  15. PHP Switch..Case Conditional Statements
  16. PHP For and Foreach Loop Statements
  17. PHP While and Do While Statements
  18. PHP Functions
  19. PHP Class and Objects
  20. PHP Date and Time Operations

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

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.

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.

LEARN MORE  Python Convert String To Int

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

PHP Tutorial Topics

  1. Introduction To PHP
  2. Installing PHP To Linux
  3. Installing PHP To Windows
  4. PHP Hello World Project with Eclipse
  5. PHP Syntax
  6. PHP Variables and Types
  7. PHP String Types
  8. PHP Numeric Type (Integer, Float, Double)
  9. PHP Boolean Type
  10. PHP Arrays
  11. PHP Operators
  12. PHP Ternary Operators
  13. PHP Constants
  14. PHP If..Elseif..Else Conditional Statements
  15. PHP Switch..Case Conditional Statements
  16. PHP For and Foreach Loop Statements
  17. PHP While and Do While Statements
  18. PHP Functions
  19. PHP Class and Objects
  20. PHP Date and Time Operations
RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/numeric-variable-types-like-integer-float-double/
PINTEREST
PINTEREST
INSTAGRAM

Leave a Reply

Your email address will not be published.