PHP Numbers

PHP Numbers In Hindi

PHP

PHP Numbers In Hindi:- PHP Variable Mai Integer Values Store Karne ke Liye Kisi Bhi Data Type Ki Jarurat Nhi Hoti Hain, Lekin Tab Ham Kiya Kare Jab Float, infinite, NaN, Value Ko Store Karana Ho? , Yani Ke Hame Is Baat Se Pata Chalta Hain ki PHP Main Data Type Ki Jarurat Nhi Hoti Hain.

To Aaj Ham PHP Numbers Ko Dekhne Wale Hain |

Numbers in PHP In Hindi

PHP Main Koi Types Ke Data Type Hote Hain for example String. Integer. Float (floating-point numbers – also called double) Boolean. Array. Object. NULL, Lekin Ab Baat Karne Wale Hain Number Data Types Ki |

PHP Integers in Hindi

Integers ek Types se Number Hote Hain Jisme Koi Decimal Value Nhi Hoti Hain – Example ke liye 10, 38, 99 etc ye Sabhi Integers Values Hoti Hain |

Integer Value Ke Kuch Rules Hote Hain |

  • Kisi Bhi integer Main Kam se Kam Ek Digit to hona hi Chahiye |
  • Integers Values Postive Or Negative Dono Ho Sakti Hain |
  • Koi Bhi Decimal Vales Integers Main Nhi Aati Hain |
  • Integers Main 3 types ke formats hi Aate Hain ( Decimal , Hexadecimal , Octal )

Agar Hame Integers Value Ko Check Karna Hain TO Uske Liye PHP Main Functions Diye Gaye Hain |

  • is_int()
  • is_integer()
  • is_long()

Example:

<?php
$x = 59;
var_dump(is_int($x));
?>

Output:

bool(true)

PHP Floats in Hindi

Float Bhi Ek Types Se Numbers hi Hote Hain | Lekin In Numbers Main Sirf Decimal Values Hi Aati Hain | Example Ke Liye Aap 2.0, 3.8, 38.00, etc Ye Sab Float Values Hi Hain |

Agar Hame Floats Value Ko Check Karna Hain TO Uske Liye PHP Main Functions Diye Gaye Hain |

  • is_float()
  • is_double() – alias of is_float()

Example:

<?php
$x = 28.8;
var_dump(is_float($x));
?>

Output:

bool(true)

PHP Infinity in Hindi

Yah Vo Values Hoti Hain Jo Float PHP_FLOAT_MAX se badi hoti hain And Is Values Ko Bhi Check Karne ke Liye 2 Tarah ke Method Hain |

Agar Hame Infinity Value Ko Check Karna Hain TO Uske Liye PHP Main Functions Diye Gaye Hain |

  • is_finite()
  • is_infinite()

Example:

<?php
//check float value
$num1 = 4.6e319;
var_dump($num1);

?>

Output:

float(INF)

PHP NaN Values in Hindi

NaN Ka Matlab Hota Hain NOT A NUMBER | Iska Istemal Impossible Mathematical Operation ke Liye Istemal Kiya Jata Hain |

Agar Hame Infinity Value Ko Check Karna Hain TO Uske Liye PHP Main Functions Diye Gaye Hain |

  • is_nan()

Example:

<?php
//check float value
$num1 = acos(8);
var_dump($num1);

?>

output:

float(NAN)

PHP Numerical String in Hindi

PHP Numerical Values Ko Check Karne Ke Liye is_numeric() Function Ka Istemal Kiya Jata Hain And Yah Method Tabhi TRUE hoga Jab Value Numbers Or numeric string Hogi |

For Example:

$b = "15.35";
var_dump(is_numeric($b));
echo "<br>";

$b= "Danish";
var_dump(is_numeric($b));

?>

Output:

bool(true)
bool(false)

Leave a Reply

Your email address will not be published. Required fields are marked *