Bug #55378 [Opn->Asn]: binary number literal returns float number though its value is enough small

From: Date: Sun, 07 Aug 2011 17:13:45 +0000
Subject: Bug #55378 [Opn->Asn]: binary number literal returns float number though its value is enough small
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-162462@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=55378&edit=1 ID: 55378 Updated by: derick@php.net Reported by: for-bugs at hnw dot jp Summary: binary number literal returns float number though its value is enough small -Status: Open +Status: Assigned Type: Bug Package: Scripting Engine problem Operating System: MacOSX PHP Version: 5.4.0alpha3 -Assigned To: +Assigned To: derickr Block user comment: N Private report: N Previous Comments: ------------------------------------------------------------------------ [2011-08-07 01:37:02] for-bugs at hnw dot jp Description: ------------ The binary numbers format(see #50648, https://bugs.php.net/bug.php?id=50648) was introduced to PHP 5.4.0alpha3. However, its boundary value is wrong for judging whether return value shoud be integer or floating point number. See test script. Test script: --------------- <?php var_dump(0b1111111); var_dump(0b1111111111111111); Expected result: ---------------- int(127) int(65535) Actual result: -------------- int(127) float(65535) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=55378&edit=1

« previous php.bugs (#162462) next »