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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: jerome dot delamarche at free dot fr
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Wed May 07 15:01:31 2025 UTC