Re: Working with internal data formats
| From: | Robert Cummings | Date: | Thu, 15 May 2008 14:53:03 +0000 |
| Subject: | Re: Working with internal data formats | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-274378@lists.php.net to get a copy of this message | ||
On Thu, 2008-05-15 at 10:33 -0400, John Gunther wrote:
> Iv Ray wrote:
> > John Gunther wrote:
> > > What technique can I use to take an 8-byte double precision value, as
> > > stored internally, and assign its value to a PHP float variable without
> > > having the bytes misinterpreted as a character string.
> >
> > Does it get misinterpreted, or do you just want to be sure?
> >
> > The documentation says -
> >
> > "Some references to the type "double" may remain in the manual. Consider
> > double the same as float; the two names exist only for historic reasons."
> >
> > Does this cover your case?
> >
> > Iv
> No.
>
> Example: I extract the 8 bytes 40 58 FF 5C 28 F5 C2 8F from an external
> file, which is the internal double precision float representation of the
> decimal value 99.99. Starting with that byte string, how can I create a
> PHP variable whose value is 99.99?
http://www.php.net/manual/en/function.unpack.php
Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP