Welcome to the Webmaster Forum.

# Thread: Floating Point Number in PHP

1. ## Floating Point Number in PHP

What is a floating point number in PHP?
Can it be double, or real number, and how does it apply to PHP programming?  Reply With Quote

2. this is a number which has a point in b/w like 2.3 you can perform any operations on it.  Reply With Quote

3. ## Re: Floating Point Number in PHP

agree with james...  Reply With Quote

4. ## Re: Floating Point Number in PHP

I was confused first with hexa decimal but once confirmed with one of my friends working as a senior developer, he told me that any number within decimal is called floating numbers whatever the type of number it is.  Reply With Quote

5. ## Re: Floating Point Number in PHP

Floating point number is decimal number.for example is 1.2 etc.  Reply With Quote

6. ## Re: Floating Point Number in PHP

Floating point number is decimal number.for example is 1.0.011.2 etc.  Reply With Quote

7. ## Re: Floating Point Number in PHP

Floating number is a decimal number.for example 2.1 etc.That are the floating number..................  Reply With Quote

8. ## Re: Floating Point Number in PHP

Floating number is decimal numbers  Reply With Quote

9. ## Re: Floating Point Number in PHP

Floating point number is an decimal number .
example is 8.2  Reply With Quote

10. ## Re: Floating Point Number in PHP

Floating point numbers have limited precision. Although it depends on the system, PHP typically uses the IEEE 754 double precision format, which will give a maximum relative error due to rounding in the order of 1.11e-16. Non elementary arithmetic operations may give larger errors, and, of course, error propagation must be considered when several operations are compounded.
Additionally, rational numbers that are exactly representable as floating point numbers in base 10, like 0.1 or 0.7, do not have an exact representation as floating point numbers in base 2, which is used internally, no matter the size of the mantissa. Hence, they cannot be converted into their internal binary counterparts without a small loss of precision. This can lead to confusing results: for example, floor((0.1+0.7)*10) will usually return 7 instead of the expected 8, since the internal representation will be something like 7.9999999999999991118....
So never trust floating number.  Reply With Quote

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•