From: snirh at inag dot pt
Operating system: WINDOWS SERVER 2003
PHP version: 4.3.10
PHP Bug Type: *Database Functions
Bug description: Operations with floating points bug
Description:
------------
Using OCI libs to return values from a database, if this values is
negative floating point the result cannot be used as number!
Reproduce code:
---------------
$sql = "SELECT (-3/5) AS floatp FROM dual";
$conn2 = ocilogon("login", "pass", $srvc);
$stmt = ociparse($conn2, $sql);
ociexecute($stmt, OCI_DEFAULT);
while (ocifetch($stmt)) {
echo $result = ociresult($stmt, "FLOATP")."\n\n";
}
echo $result + 2;
// This code return 2!!
Expected result:
----------------
1.4
Actual result:
--------------
2
--
Edit bug report at http://bugs.php.net/?id=32180&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=32180&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=32180&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=32180&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=32180&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=32180&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=32180&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=32180&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=32180&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=32180&r=support
Expected behavior: http://bugs.php.net/fix.php?id=32180&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=32180&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=32180&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=32180&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=32180&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=32180&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=32180&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=32180&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=32180&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=32180&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=32180&r=mysqlcfg