php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37206 hexdec can not handle "NAN" and "INF" problem
Submitted: 2006-04-26 05:29 UTC Modified: 2006-04-26 07:26 UTC
From: sqchen at cititz dot net Assigned:
Status: Not a bug Package: *Math Functions
PHP Version: 5.1.2 OS: redhat 7.3
Private report: No CVE-ID: None
 [2006-04-26 05:29 UTC] sqchen at cititz dot net
Description:
------------
please see file  "ext/standard/math.c" and function "PHPAPI int _php_math_basetozval(zval *arg, int base, zval *ret)", It's obvious that it does not consider the "NAN" and "INF" problem

Reproduce code:
---------------
<?php
hexdec(INF);
hexdec(NAN);
?>

Expected result:
----------------
to be decided
to be decided

Actual result:
--------------
15  (actually It just convert "f" to decimal)
10  (covert "A" to decimal)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-04-26 07:26 UTC] tony2001@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 19:01:30 2024 UTC