Req #55464 [Opn->Bgs]: differ is_float() from is_double()
| From: | cataphract@php.net | Date: | Tue, 23 Aug 2011 03:45:31 +0000 |
| Subject: | Req #55464 [Opn->Bgs]: differ is_float() from is_double() | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-162824@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=55464&edit=1
ID: 55464
Updated by: cataphract@php.net
Reported by: zandor_zz at yahoo dot it
Summary: differ is_float() from is_double()
-Status: Open
+Status: Bogus
Type: Feature/Change Request
Package: Variables related
Operating System: any
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
There is only one floating point type in PHP -- it is named float, with "double" (and
"real") as an alias and the underlying representation is a C double. Both is_float and
is_double (and also is_real) test for this type. So the proposal makes no sense. As such, I'm
closing this as bogus.
What I think you actually wanted to suggest is introducing a new type with single precision. This
would be a rather big change with no compelling advantages (the double can represent all the values
the float can) and possible BC breaks. In any case, such a change would require extended discussion;
see https://wiki.php.net/rfc
Previous Comments:
------------------------------------------------------------------------
[2011-08-19 20:02:14] zandor_zz at yahoo dot it
Description:
------------
It would be nice to differ the behavior of is_float() from is_double(). This
situation is not consistent cause float and double do differ for different
byte size.
I have created a PHP class to handle advanced read/write operations on files and I
crashed onto this ambiguous situation. Thus I wrote myself a workaround to solve
this ambiguous situation. Then I suggest that it would be nice to rely on this
feature in the standard PHP library.
Test script:
---------------
It is known from PHP standard documentation that is_double() is an alias of is_float().
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=55464&edit=1