#22516 [Opn]: Pack&Unpack

From: Date: Mon, 03 Mar 2003 12:12:36 +0000
Subject: #22516 [Opn]: Pack&Unpack
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-34664@lists.php.net to get a copy of this message
ID: 22516 Updated by: phanto@php.net Reported By: eugen at iwep dot ab dot ru Status: Open Bug Type: Scripting Engine problem Operating System: Windows 2000 PHP Version: 5CVS-2003-03-03 (dev) New Comment: i reproduced that. seems that due to the fact that php's floats are actually doubles only half of the double gets initialized and should be initialized with 0.0 first. Previous Comments: ------------------------------------------------------------------------ [2003-03-03 04:04:00] eugen at iwep dot ab dot ru Hi all, Please try <? $dat=pack ("f", 1.1); $ar=unpack('fx',$dat); print 'x='.$ar['x'].'<br>'; ?> Output: x=1.10000002384 ^^^^^^^^^^^^^^^^?????????????? maybe bug with float ? ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=22516&edit=1

« previous php.bugs (#34664) next »