php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #12046 Strange handling of negative hexadecimal numbers
Submitted: 2001-07-11 08:04 UTC Modified: 2001-10-18 15:42 UTC
From: jerome dot delamarche at free dot fr Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0.6 OS: Linux 2.4
Private report: No CVE-ID: None
 [2001-07-11 08:04 UTC] jerome dot delamarche at free dot fr
When I initialize variables with hexadecimal integers, the positive ones are well handled but the negative ones are considered as flots.

Try the followin code:

<?php
$n1 = 0x23456789;  // positive
$n2 = 0x98765432;  // negative
echo "$n1,$n2\n";
?>

it outputs:
591751049,1.1911111110821

Jerome

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-07-15 12:56 UTC] zeev@php.net
For me, this example outputs the same (correct) results under both Windows and Linux:

591751049,2557891634

 [2001-10-18 15:42 UTC] sander@php.net
Works fine for me... unable to reproduce...
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 02:02:52 2024 UTC