#49342 [Opn->Bgs]: gnu_cmp doesn't work with decimal strings

From: Date: Mon, 24 Aug 2009 09:33:33 +0000
Subject: #49342 [Opn->Bgs]: gnu_cmp doesn't work with decimal strings
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-141419@lists.php.net to get a copy of this message
 ID:               49342
 Updated by:       sjoerd@php.net
 Reported By:      scott at connerly dot net
-Status:           Open
+Status:           Bogus
 Bug Type:         GNU MP related
 Operating System: Linux
 PHP Version:      5.2.10
 New Comment:

Thank you for your bug report.

The documentation on GMP says:
These functions allow you to work with arbitrary-length integers using
the GNU MP library.

Since 2.5 is not an integer, I don't think your example is supposed to
work. Also, I can't find the example on the function.gmp-cmp page, so it
also does not seem an error in the documentation.


Previous Comments:
------------------------------------------------------------------------

[2009-08-24 04:36:24] scott at connerly dot net

Description:
------------
gnu_cmp doesn't work with decimal strings



Reproduce code:
---------------
---
From manual page: function.gmp-cmp
---

$integers = gmp_cmp('2','5');
$floats = gmp_cmp('2.5','5');

var_dump($integers,$floats);

Expected result:
----------------
both should return -1

Actual result:
--------------
int(-1)
bool(false)



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=49342&edit=1



Thread (2 messages)

« previous php.bugs (#141419) next »