php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56814 Float exponential not supported
Submitted: 2006-02-01 13:14 UTC Modified: 2006-05-13 21:56 UTC
From: x dot philbert at pixandlog dot com Assigned: pajoye (profile)
Status: Closed Package: filter (PECL)
PHP Version: 5.1.1 OS: Linux Gentoo
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: x dot philbert at pixandlog dot com
New email:
PHP Version: OS:

 

 [2006-02-01 13:14 UTC] x dot philbert at pixandlog dot com
Description:
------------
Hi. I found a new bug with float value.
I don't catch float value with exponential.
Exemple : 1.2e3 or 1.2e-3.

See documentation : http://www.php.net/manual/en/language.types.float.php

I try to receive a float value 1.2e3, 1.2E3, 1.2e-3 in input_get.



Reproduce code:
---------------
<?php
//$_GET['myfloat'] == '1.2e3';
$var = 1.2e3;
var_dump($var);
$var = 148798498444984987498987;
var_dump($var);

$source = INPUT_GET;
$name = 'myfloat';
$ret = input_get($source, $name);
var_dump($ret);
?>


Expected result:
----------------
float(1200)
float(1.4879849844499E+23)
float(1200)


Actual result:
--------------
float(1200)
float(1.4879849844499E+23)
NULL


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-02-02 13:29 UTC] x dot philbert at pixandlog dot com
Hi.

I wrote a little change of logical_filter.c version. I worked on cvs file revision 1.21 2006/01/31 19:12:29.

I don't send the file and not copy here because it's too large.

But you could download the file here :
http://194.250.173.209/~xavier/logical_filters-cvs-xavier-20060202-19h16.patch
or the full file :
http://194.250.173.209/~xavier/logical_filters.c

I try to perform E and e with +-. So now we will can to give
12.25; -12.25; 0.02; 0.; 0.42; 12e3; +12E3; -12e3; 12E-3; 0E2; 10E0; 10e-0; 0.E2; .2E+5; .04e-2; +32.042E+8; +2E499; -2E499

With these values we will catch an error (so return == NULL):
E2; +E2; -E2; 10E; 2E+; 2E-

If you will find another tests, please contact me for my unit tests with SimpleTests. Sorry i don't know how work phpt files. I know to write these but not launch.

Bye good night or day.
 [2006-05-13 21:56 UTC] pierre dot php at gmail dot com
This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pecl.php.net.

In case this was a pecl.php.net website problem, the change will show
up on the website in short time.
 
Thank you for the report, and for helping us make PECL better.

Thanks for the patch. However I was only adding this features and the custom decimal separator and did not use it, maybe next time :)
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sat Feb 23 13:01:26 2019 UTC