PHP Numbers

Sujitha

 Php Numbers

       In PHP, a "number" typically refers to a numeric data type that represents numerical values.

Php Integer

       In PHP, an integer is a numeric data type that represents whole numbers without decimal points. Integers can be both positive and negative.

9,21,533,-8765,-244,755 are all integers.

 php has the follwing predefined constant for integers:

PHP_INT_MAX- the maximum  integer values for your system.

PHP_INT_MIN- the minimum integer values for your system.

Php floats

        Floating-Point Numbers Also known as "floats" or "doubles," these are numbers with decimal points. They can represent both integer and non-integer values.

54.7,246.87,634f. 5,98. 65 are all floats.

php has the follwing predefined constant for floats:

PHP_FLOAT_MAX- the largest positive finite floating-point value that can be represented on the system.

PHP_FLOAT_MIN- this constant represents the smallest representable positive floating-point.

Php infinity

        These constants are used to represent mathematical infinity in PHP.infinity is a special numeric value that represents positive or negative infinity

PHP provides the constant

INF to represent positive infinity.

-INF to represent negative infinity.

Php Nan

       NaN (Not-a-Number) represents a value that is undefined or unrepresentable.

       The comparisons involving NaN will typically result in false, and you can use the is_nan() function to check if a value is NaN.

Php Numerical strings

        In PHP, you can work with numerical strings, which are strings that contain numeric values. 




Our website uses cookies to enhance your experience. Learn More
Accept !

GocourseAI

close
send